Notice: Undefined Variable:
-
Hi, Im using a custom code to show different prices on cart based on payment gateway. It was working fine but now this error is popping up, my payment gateways doesnt work.
Notice: Undefined variable: increaseby_sam in /public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()’d code on line 24
this is my part of the code,line 24 is
$cart_item[‘data’]->set_price( $price + ( $price * $increaseby_sam ) / 97 );
?I don’t know how to repair the snippet code would you mind helping me to fix the issue?
thanks
if ( $chosen_payment_method == 'samipg' ) { $increaseby_sam = 3; } // Loop through cart items foreach ( $cart->get_cart() as $cart_item_key => $cart_item ) { // Get price $price = $cart_item['data']->get_price(); // Set price $cart_item['data']->set_price( $price + ( $price * $increaseby_sam ) / 97 ); }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Notice: Undefined Variable:’ is closed to new replies.