• Resolved akshat05

    (@akshat05)


    Hi,

    I want to set the 1st option in my shipping list as default, so even if the user does a page refresh on checkout page, the 1st shipping option should be selected.
    And I have disabled the shipping selection from cart page by adding the following filer.

    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 );

    Kindly help me to with default selection of the shipping method.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi akshat05,

    is it not enough to set the shipping method in the zone first?

    The default Shipping Method for customers is the top listed…https://docs.woocommerce.com/document/setting-up-shipping-zones/#section-8

    Thread Starter akshat05

    (@akshat05)

    Hi @jablonowski,

    No, if user does a page reload or goes back from the checkout page to another page and comes back to checkout page, then the previously selected method is selected by default.

    Thanks

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    if user does a page reload or goes back from the checkout page to another page and comes back to checkout page, then the previously selected method is selected by default.

    I was able to replicate this, and it’s a nice little feature for customers.

    This is a development topic that I’m not able to help with. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:
    * WooCommerce Slack Community: https://wcslack.herokuapp.com
    * Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/

    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    We haven’t heard back from you or anyone else in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Select Default Shipping method’ is closed to new replies.