How to Restrict Free Shipping in Magento
Online stores often offer free shipping to their customers. But what if you want to restrict free shipping to certain locations or minimum cart totals? We recently had to set up free shipping on orders over $50 to the continental U.S. (sorry Alaska and Hawaii) for a client. We'll show you how we did it using Magento, our open-source eCommerce platform of choice.
With Magento's built-in settings, you can achieve free shipping in one of two ways: the free shipping method, or free shipping using a specific carrier method.
The free shipping method simply gives the store owner the option to offer generic free shipping not specific to any carrier. This is equivalent to Amazon.com's Free Super Saver Shipping. The customer can select the free shipping option, and the store owner ships the order using whichever carrier and method they would like to use. This shipping option allows the store owner to set a minimum order total to qualify for free shipping.
The second built-in setting is carrier free shipping. Using this method, you can specify in a carrier's shipping settings which method (if any) should be free. Like the generic free shipping method above, you can set a minimum order total for the customer to qualify for free shipping. For example, if I use UPS to ship all of my orders, I'll go to the UPS shipping settings in the Magento System Configuration. I can then specify a free shipping method (such as Ground), and a minimum order requirement.
These two built-in free shipping settings may work well for many online stores, but some store owners would like to only offer free shipping to certain geographic regions. In our case, we were working with a client who wanted to restrict free shipping to the continental U.S due to the high cost of shipping to Alaska and Hawaii. Unfortunately, Magento's shipping settings do not allow restricting free shipping based on geography. Luckily, however, there's an easy way to create free shipping based on geographical regions using Magento's built-in shopping cart price rules."
Magento calculates shipping costs for carriers like FedEx and UPS based on zip codes. In order to achieve free shipping for specific geographical regions, you need to determine the set of zip codes associated with those regions. For our example, we wanted to provide free shipping to the U.S. excluding Alaska, Hawaii, and U.S. territories. So we did some research about U.S. zip codes, and formulated a set of rules to apply free shipping to only the continental U.S. In addition, we also set a minimum order amount of $50 in order to qualify for free shipping. Click on the "Conditions" tab to define these rules.
To reiterate this, the set of all zip codes for locations in the continental U.S. (excluding of course Alaska, Hawaii, and U.S. territories) can be defined as follows:
- Zip code is greater than 00900 but less than 96200
- Zip code is equal to or greater than 97000 but less than 99500
Finally, you just need to define what will happen when the conditions are met. In this case, we want tp provide free shipping when the conditions are met (the location is within the continental U.S. and the order total is $50 or greater). To do this, we click on the "Actions" tab. Under the "Free shipping" setting, change it to "For shipment with matching items."
Congrats! You now have free shipping set up for any order equal or exceeding $50 shipped within the continental United States. To check it, take a look at the cart's shipping estimate calculator.
Creating your own rules
What if you want to provide free shipping to Alaska and Hawaii, but you don't want to provide it to some other region? You can apply the same technique for mapping and excluding certain zip codes. Check out this map and list for reference:
The first digit of the ZIP code is allocated as follows:
- 0 = Connecticut (CT), Massachusetts (MA), Maine (ME), New Hampshire (NH), New Jersey (NJ), Puerto Rico (PR), Rhode Island (RI), Vermont (VT), Virgin Islands (VI), Army Post Office Europe (AE), Fleet Post Office Europe (AE)
- 1 = Delaware (DE), New York (NY), Pennsylvania (PA)
- 2 = District of Columbia (DC), Maryland (MD), North Carolina (NC), South Carolina (SC), Virginia (VA), West Virginia (WV)
- 3 = Alabama (AL), Florida (FL), Georgia (GA), Mississippi (MS), Tennessee (TN), Army Post Office Americas (AA), Fleet Post Office Americas (AA)
- 4 = Indiana (IN), Kentucky (KY), Michigan (MI), Ohio (OH)
- 5 = Iowa (IA), Minnesota (MN), Montana (MT), North Dakota (ND), South Dakota (SD), Wisconsin (WI)
- 6 = Illinois (IL), Kansas (KS), Missouri (MO), Nebraska (NE)
- 7 = Arkansas (AR), Louisiana (LA), Oklahoma (OK), Texas (TX)
- 8 = Arizona (AZ), Colorado (CO), Idaho (ID), New Mexico (NM), Nevada (NV), Utah (UT), Wyoming (WY)
- 9 = Alaska (AK), American Samoa (AS), California (CA), Guam (GU), Hawaii (HI), Marshall Islands (MH), Federated States of Micronesia (FM), Northern Mariana Islands (MP), Oregon (OR), Palau (PW), Washington (WA), Army Post Office Pacific (AP), Fleet Post Office Pacific (AP)
Addoa on Twitter
We know your vision is important to you. That's why our vision is to help you share yours. When you use Addoa for your creative needs, you'll see the difference excellence makes on your project. Our superior quality, strong communication, attitude and unbeatable value make Addoa the right choice for any project.