Wallet reduction is not updating in checkout form
-
Hi,
In our site, after cashback on 500,wallet is reduced with 100 for next 5 purchases.
the code is here
add_filter('woo_wallet_partial_payment_amount', 'woo_wallet_partial_payment_amount_callback', 100); function woo_wallet_partial_payment_amount_callback($amount) { if (sizeof(WC()->cart->get_cart()) > 0) { $get_current_user_id = get_current_user_id(); // get count of purchase of a customer having cashback $count_purchase = wc_get_customer_order_count( $get_current_user_id ); $totals = WC()->cart->get_totals(); $cart_total = $totals['subtotal'] + $totals['shipping_total'] + $totals['subtotal_tax'] + $totals['shipping_tax']; if($cart_total < $amount){ add_filter('is_valid_payment_through_wallet', '__return_true'); //add_filter( 'woocommerce_available_payment_gateways' , 'change_payment_gateway', 20, 1); } if( $count_purchase <= 5 ){ $amount = 100; } if ($amount > woo_wallet()->wallet->get_wallet_balance(get_current_user_id(), 'edit')) { $amount = woo_wallet()->wallet->get_wallet_balance(get_current_user_id(), 'edit'); } } return $amount; }
But when we select cash on delivery with amount > wallet amount, the wallet is reduced and shows remaining total in the cart form. but in the checkout page shows the full amount(not the 100 minused amount). In the emails, the amount are correct (shows amount – 100)
please help me
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Wallet reduction is not updating in checkout form’ is closed to new replies.