Hide All Shipping Methods Except “Free Shipping” and “Local Pickup” in WooCommerce

Do you want to hide all shipping methods except ‘Free Shipping’ and ‘Local Pickup’ in WooCommerce?

By default, WooCommerce shows all shipping methods that match the customer’s criteria and cart contents. Free shipping and local pickup are displayed alongside flat rates and other available shipping methods, even if the customer is qualified for free shipping and local pickup.

Therefore, to enhance the shopping cart experience for customers and prevent confusion, it’s beneficial to automatically hide other shipping methods when free shipping and local pickup are available in WooCommerce.

Why Hide Other Shipping Methods when ‘Free Shipping’ and ‘Local Pickup’ are Available in WooCommerce

Hiding all shipping methods except “Free Shipping” and “Local Pickup” in WooCommerce offers several benefits for both store owners and customers:

1. Improved User Experience

  • Simplicity: Customers are not overwhelmed by too many shipping options, making the checkout process easier and faster.
  • Clarity: Offering only “Free Shipping” and “Local Pickup” eliminates confusion about shipping costs and delivery methods, leading to more confident purchasing decisions.

2. Increased Sales Conversion

  • Attractive Free Shipping: Highlighting “Free Shipping” can encourage customers to complete purchases, as it’s a highly appealing offer for many buyers.
  • Local Pickup Convenience: Customers living near your physical location will appreciate the option to pick up their items, saving them shipping costs and wait times.

3. Reduced Cart Abandonment

  • Avoid Unexpected Costs: By limiting the shipping options, you prevent customers from abandoning their carts due to unexpected or high shipping charges that may arise with other methods.

4. Optimized Shipping Strategy

  • Cost Control: Offering just “Free Shipping” (usually with conditions, such as a minimum order) and “Local Pickup” can help you reduce shipping costs while still providing convenient options for customers.
  • Focus on Key Methods: You can focus on making these shipping methods efficient, saving on logistics and operational complexity.

5. Encourages Local Engagement

  • Promotes Local Pickup: If you have a local store, offering “Local Pickup” can encourage foot traffic to your physical location, creating opportunities for future in-store purchases.

6. Brand Loyalty and Trust

  • Customer Trust: Providing simple, clear shipping methods like “Free Shipping” and “Local Pickup” builds trust, as customers are often wary of hidden fees or confusing shipping options.
  • Customer Satisfaction: Streamlining the shipping process enhances customer satisfaction, leading to potential repeat purchases.

7. Increased Profit Margins

  • Lower Shipping Costs: By encouraging local pickup or limiting free shipping to specific conditions (like order minimums), you reduce the need to cover shipping fees for all orders, potentially increasing your profit margins.

This strategy can help streamline operations, improve customer experience, and potentially boost sales for your WooCommerce store.

Hide Other Shipping Methods when ‘Free Shipping’ and ‘Local Pickup’ are Available on WooCommerce

Use the code snippets below to hide other shipping methods except ‘Free Shipping’ and ‘Local Pickup’ are available in WooCommerce

php
/**
 * Hide shipping rates except "free shipping" and "Local pickup"
 * Updated to support WooCommerce 2.6 Shipping Zones
 */
function maverick_other_hide_shipping_methods($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', 'maverick_other_hide_shipping_methods', 10, 2);

Leave a Reply

Your email address will not be published. Required fields are marked *