Woocommerce checkout: Update cost OR update total price via “update_checkout” aj
-
So, i trigger
update_checkout
via javascript. Then, i have function to be called inwoocommerce_review_order_before_shipping
hook. The function is to add/removefree_shipping
shipping method (it’s based on Cash on Delivery availability).There are two radio buttons of payment method:
– Direct Transfer
– Cash on DeliveryThe script already works. So when i choose COD (Cash on Delivery), the free shipping method is selected automatically.
But, the problem is the total price did not changed, this indicates that the cost is still available. Well, it changed, but it is late. I said late because the total price is canged when i change the payment method by choosing Direct Bank Transfer radio button.
The question is,
1. why the total price doesn’t update realtime when the payment method is changed? Ok, it changed but in the next change event.
2. what is WooCommerce API to update the total price OR to update the cost? Where in the hook should i place this??? Thank you very much for answering
- The topic ‘Woocommerce checkout: Update cost OR update total price via “update_checkout” aj’ is closed to new replies.