• Resolved psiim18

    (@psiim18)


    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/jaVjoXQs8phh

    I 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!

Viewing 1 replies (of 1 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @psiim18,

    Thanks for reaching out!

    Once you enter the billing/shipping address on the checkout page the shipping rates will be displayed on checkout and cart as well. That’s the expected behavior.

    You’re using custom code which falls outside our scope of support. I’m going to leave the thread open for a bit to see if anyone is able to chime in to help you out. Feel free to share log errors to have more details.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

Viewing 1 replies (of 1 total)
  • The topic ‘Cart page shipping calculation error’ is closed to new replies.