• Resolved Prixer

    (@prixer)


    Plugin’s shipping methods does not show When this snippet
    “Hide other shipping methods when “Free Shipping” is available” is active
    as documented in this page:

    https://docs.woocommerce.com/document/hide-other-shipping-methods-when-free-shipping-is-available/

    /**
    * Hide shipping rates when free shipping is available, but keep “Local pickup”
    * Updated to support WooCommerce 2.6 Shipping Zones
    */

    function hide_shipping_when_free_is_available( $rates, $package ) {
    $new_rates = array();
    foreach ( $rates as $rate_id => $rate ) {
    // Only modify rates if free_shipping is present.
    if ( ‘free_shipping’ === $rate->method_id ) {
    $new_rates[ $rate_id ] = $rate;
    break;
    }
    }

    if ( ! empty( $new_rates ) ) {
    //Save local pickup if it’s present.
    foreach ( $rates as $rate_id => $rate ) {
    if (‘local_pickup’ === $rate->method_id ) {
    $new_rates[ $rate_id ] = $rate;
    break;
    }
    }
    return $new_rates;
    }

    return $rates;
    }

    add_filter( ‘woocommerce_package_rates’, ‘hide_shipping_when_free_is_available’, 10, 2 );

    I have set in amount 0.00 and the shipping method is not showing
    (I want to have to 2 free shipping options)

    • This topic was modified 6 years, 1 month ago by Prixer.
    • This topic was modified 6 years, 1 month ago by Prixer.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Prixer

    (@prixer)

    I have set in amount 0.00

    Afsana

    (@afsanamultanii)

    Dear Customer,

    I hope you are doing well!

    Thank you for writing to us, I apologize for the delay in writing you back.

    The settings that you require is not available in the plugin at the moment. But, it is possible with customization option for your specific site requirement.

    Please create a Support Ticket with the detail; our technical team will get back to you shortly.

    Thank you for your patience.

    Regards,

    Afsana
    DotStore Customer Support Executive

    Plugin Author Dotstore

    (@dots)

    Hello @prixer,

    I hope now issue has been resolved!

    Please let us know still you facing any issue or create support ticket from here.

    Thanks & regards,
    DotStore support Team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin’s shipping methods does not show when:’ is closed to new replies.