Cart page shipping calculation error
-
Hello,
I turn off the shipping calculation on the cart page. Now I have a problem if the customer goes to the checkout page and chooses a shipping method and then moves back to the cart page then displays the previously selected shipping price too there. How to display this situation only product price?
Example:
1. Cart page (all correct) – https://prnt.sc/n4AUuSeLuIE7
2. Checkout page customer chose shipping method – https://prnt.sc/HwU2cR3EaTSR
3. Now moving back to the cart page (display total price – product price and shipping price): https://prnt.sc/jaVjoXQs8phhI added the PHP code:
function disable_shipping_calc_on_cart( $show_shipping ) {
if( is_cart() ) {
return false;
}
return $show_shipping;
}
add_filter( ‘woocommerce_cart_ready_to_calc_shipping’, ‘disable_shipping_calc_on_cart’, 99 );Its works but woocommerce log show error messages. Can you advise better PHP code or whats the correct solution for this problem is?
Thanks for the help!
- The topic ‘Cart page shipping calculation error’ is closed to new replies.