how to exclude a state from US shipping in Magento?

how to exclude a state from US shipping in Magento?

September 17, 2026 · Illustrated author avatarBy Stefan Bogdanescu
how to exclude a state from US shipping in Magento?

Excluding Hawaii from Free Shipping in Magento

As an e-commerce developer specializing in Magento, I often encounter clients who need to exclude certain regions or states from their free shipping offers due to high shipping costs. In this post, we’ll explore how you can remove Hawaii from the default “Free Shipping” module in Magento.

Understanding Free Shipping Configuration

First, let’s clarify the current configuration setup:

  1. You’ve enabled free shipping for all US states using the default “Free Shipping” module.
  2. You’ve configured table rates for all Canadian provinces separately.

The key challenge is that the default “Free Shipping” module applies to all selected states in the country. It doesn’t support exclusion based on individual state selection within a country.

Limitations of Default Modules

Before proceeding, it’s essential to understand two critical limitations:

  • No built-in exclusion: The Free Shipping module lacks an option to exclude specific states from a country.
  • Complexity with extensions: While Magento offers numerous shipping extensions, most require significant customization and may not provide the straightforward solution you need.

A Custom Solution: Exclude Hawaii via Observer

To achieve this, we’ll create a custom observer that modifies the Free Shipping module’s behavior. Here’s a step-by-step guide:

  1. Create an observer: In your Magento project, navigate to app/code/local/YourCompany/Shipping/etc/config.xml. Add the following observer configuration within the <config> tag:
<global>
    <events>
        <enterprise_shipping_methods_collect_carrier_rates>
            <observers>
                <yourcompany_check_shipment_exclusion>
                    <type>singleton</type>
                    <class>YourCompany_Shipping_Model_Observer</class>
                    <method>checkHawaiiExclusion</method>
                </yourcompany_check_shipment_exclusion>
            </observers>
        </enterprise_shipping_methods_collect_carrier_rates>
    </events>
</global>

Replace YourCompany with your Magento namespace.

  1. Create the observer class: Create a new file at app/code/local/YourCompany/Shipping/Model/Observer.php. Implement the checkHawaiiExclusion method:
class YourCompany_Shipping_Model_Observer
{
    public function checkHawaiiExclusion($observer)
    {
        $quote = $observer->getQuote();
        $shippingAddress = $quote->getShippingAddress();

        if ($shippingAddress->getCountryId() == 'US' && $shippingAddress->getRegionCode() == 'HI') {
            foreach ($quote->getAllItems() as $item) {
                $item->setSkipCheckout(true);
            }
        }
    }
}

This observer checks the shipping address. If it’s for Hawaii, it sets all items in the cart to skip checkout.

Conclusion

Excluding a state like Hawaii from the Free Shipping module requires creating a custom solution using observers. While it involves some development work, this approach provides precise control over your shipping configurations without resorting to complex extensions or significant code rewrites.

Remember that every Magento installation is unique. Always test these changes thoroughly in a staging environment before deploying them to your production site.

If you’re looking for expert Magento development services, feel free to reach out to Laravel Company. Our team specializes in customizing Magento to meet your specific business needs.

This concludes our discussion on excluding Hawaii from Magento’s Free Shipping module. Happy coding!

Database Extensions Configuration CLI

Our network