US continental shipping and Magento

A lot of websites in the US offer free ground shipping nowadays. However, most restrict to US continental. State-wise, this means all states except for Alaska an Hawaii. However, the US has a lot of protectorates that do not qualify as continental: American Samoa, all the “Armed Forces”, Micronesia, Guam, Marshall Islands, Mariana Islands, Palau, Puerto Rico, Virgin Islands.

That’s one way to look at it. The other is looking at the zip codes that are not qualified for free shipping. It looks like the continental USA is:

  • between 00900 and 96200 OR
  • between 97000 and 99500

Putting all this together as a set of conditions for a Magento shopping cart rule:

Screen Shot 2018-05-11 at 12.02.13

If you’re using Magento 1, here is the string you can paste in the salesrule table, conditions_serialized field:

 

a:7:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:18:{i:0;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:10:"country_id";s:8:"operator";s:2:"==";s:5:"value";s:2:"US";s:18:"is_value_processed";b:0;}i:1;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"2";s:18:"is_value_processed";b:0;}i:2;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"21";s:18:"is_value_processed";b:0;}i:3;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"3";s:18:"is_value_processed";b:0;}i:4;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"6";s:18:"is_value_processed";b:0;}i:5;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"7";s:18:"is_value_processed";b:0;}i:6;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"8";s:18:"is_value_processed";b:0;}i:7;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:1:"9";s:18:"is_value_processed";b:0;}i:8;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"10";s:18:"is_value_processed";b:0;}i:9;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"11";s:18:"is_value_processed";b:0;}i:10;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"17";s:18:"is_value_processed";b:0;}i:11;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"20";s:18:"is_value_processed";b:0;}i:12;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"30";s:18:"is_value_processed";b:0;}i:13;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"46";s:18:"is_value_processed";b:0;}i:14;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"50";s:18:"is_value_processed";b:0;}i:15;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"52";s:18:"is_value_processed";b:0;}i:16;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:9:"region_id";s:8:"operator";s:2:"!=";s:5:"value";s:2:"60";s:18:"is_value_processed";b:0;}i:17;a:7:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"any";s:10:"conditions";a:2:{i:0;a:7:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:2:{i:0;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:8:"postcode";s:8:"operator";s:1:">";s:5:"value";s:5:"00900";s:18:"is_value_processed";b:0;}i:1;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:8:"postcode";s:8:"operator";s:1:"<";s:5:"value";s:5:"96200";s:18:"is_value_processed";b:0;}}}i:1;a:7:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";s:10:"conditions";a:2:{i:0;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:8:"postcode";s:8:"operator";s:2:">=";s:5:"value";s:5:"97000";s:18:"is_value_processed";b:0;}i:1;a:5:{s:4:"type";s:32:"salesrule/rule_condition_address";s:9:"attribute";s:8:"postcode";s:8:"operator";s:1:"<";s:5:"value";s:5:"99500";s:18:"is_value_processed";b:0;}}}}}}}

 

I’m guessing all this changes and may not even be 100% accurate, but it’s the best I could find as far as “free continental shipping” goes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s