You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason the closing </b> is messing with the < less than in the if statement. I switched it to if ($cart_item['quantity'] > $square_quantity) { to resolve it.
What it is supposed to look like:
if ($square_quantity < $cart_item['quantity']) {
wc_clear_notices();
wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</b> in stock. Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
$woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
}
What I get:
if ($square_quantity <b $cart_item['quantity']) {
wc_clear_notices();
wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</b> in stock. Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
$woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
}
or
if ($square_quantity < $cart_item['quantity']) {
wc_clear_notices();
wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</> in stock. Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
$woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
}
The text was updated successfully, but these errors were encountered:
For some reason the closing
</b>
is messing with the<
less than in the if statement. I switched it toif ($cart_item['quantity'] > $square_quantity) {
to resolve it.What it is supposed to look like:
What I get:
or
The text was updated successfully, but these errors were encountered: