• Resolved ecomlux

    (@ecomlux)


    Hi,
    I set up a few scenarios on my e-commerce for the delivery:
    – 5€ delivery fee for orders under 50€
    – Free delivery for orders above 50€
    – Local pick up – anytime

    The problem is that once my orders exceeds 50€ (=eligible for free shipping) the local pick up option disappears.
    I wanted to know how to avoid this ? I need always the two options activated. (Delivery free/pay & local pickup)

    Cheers,
    Jeremy

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

    I set up a few scenarios on my e-commerce for the delivery: 5€ delivery fee for orders under 50€, Free delivery for orders above 50€ and Local pick up – anytime.

    The problem is that once my orders exceeds 50€ (=eligible for free shipping) the local pick up option disappears. I wanted to know how to avoid this ? I need always the two options activated. (Delivery free/pay & local pickup)

    From what I understand, you’re having trouble with the local pickup option disappearing when orders go over 50€ and qualify for free shipping. You want both options—free/pay delivery and local pickup—to be available at all times.

    Let’s try to fix that! First, make sure you’ve correctly set up both the ‘Free Shipping’ and ‘Local Pickup’ methods. Here’s how to do it:

    1. Go to your WooCommerce settings and click on the ‘Shipping‘ tab.
    2. Check under ‘Shipping Zones‘ to see if you have a zone that includes the locations where you want to offer both free shipping and local pickup.
    3. In this zone, click ‘Add Shipping Method‘ and add both ‘Free Shipping‘ and ‘Local Pickup‘.
    4. Set a minimum order amount of 50€ for the ‘Free Shipping‘ method.
    5. Make sure ‘Local Pickup‘ doesn’t have any conditions attached to it.

    Doing this should make both options available at all times, no matter the order amount. Need a hand with that? Here’s a handy guide on ?? Setting up Shipping Zones.

    If you’ve already done this and the issue still isn’t resolved, it might be due to a conflict with your theme or another plugin. To find out, try temporarily switching to a default theme (like Storefront) and disabling all other plugins to see if the problem persists. Here’s a handy guide on testing for conflicts: ?? How to Test for Plugin and Theme Conflicts.

    If you’re still stuck, it would be great if you could send us a screenshot of your shipping settings. This will help us understand the situation better and provide a more accurate solution. You can share screenshots at https://snipboard.io. Just follow the instructions on the page and paste the URL in your response.

    We’d also like to see your site’s System Status report. This will give us a better idea of your site’s setup and help us pinpoint the problem. You can find the report under WooCommerce > Status. Choose Get system report and then Copy for support.

    If there are any fatal error logs, please share those too. You can find them under WooCommerce > Status > Logs.

    Once you’ve gathered this information, please paste it inside a Code block in your reply, or use https://pastebin.com to paste it and share the link with us.

    Thanks for your patience and cooperation! We’re here to help you sort this out.

    Thread Starter ecomlux

    (@ecomlux)

    Hi Tamrat,

    Thanks a lot for your detailed answer.

    Indeed, after some research I found the issue, I had a function set up to hide the flat rate when free shipping is available. As I have to delete/edit the function, can you tell me how to do so? To hide the flat rate when free shipping is available ?

    Here is the function I was using:

    function my_hide_shipping_when_free_is_available( $rates ) {
    $free = array();
    foreach ( $rates as $rate_id => $rate ) {
    if ( ‘free_shipping’ === $rate->method_id ) {
    $free[ $rate_id ] = $rate;
    break;
    }
    }
    return ! empty( $free ) ? $free : $rates;
    }
    add_filter( ‘woocommerce_package_rates’, ‘my_hide_shipping_when_free_is_available’, 100 );

    The problem of this function is that it also hides the local pick-up.

    Kind regards,

    Jeremy

    • This reply was modified 1 year ago by ecomlux.
    Thread Starter ecomlux

    (@ecomlux)

    Update:
    I found a solution by using this function:

    add_filter( 'woocommerce_package_rates', 'bbloomer_unset_shipping_when_free_is_available_in_zone', 9999, 2 );

    functionbbloomer_unset_shipping_when_free_is_available_in_zone( $rates, $package) {

       // Only unset rates if free_shipping is available

       if( isset( $rates['free_shipping:8'] ) ) {

          unset( $rates['flat_rate:1'] );

       }    

       return$rates;

    }

    Kind regards,

    Jeremy

    Hi @ecomlux,

    Thank you for reaching out to us and for sharing the solution you found. I’m glad to hear that you were able to resolve the issue with the shipping options on your site.

    The function you provided indeed unsets the flat rate when free shipping is available. This should work perfectly for the setup you described.

    I’ll go ahead and mark this thread as resolved. However, if you ever have more questions or issues in the future, don’t hesitate to kick off a new topic.

    Hope you have a fantastic day!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Keep local pick-up always available’ is closed to new replies.