Filter available shipping type by a long list of zip codes
Hi,
My customer is shipping frozen food, so I have 2 shipping types – Flat Rate for zip codes within 2 days, and UPS air for others within the US.
In the rules for those 2 types, I want to add a condition that will check that the Postal Code "Begins with" [00, 01, 02, etc.] (I have a list of ~120 postal "prefixes" of 2-3 characters, representing 1000s of postal codes from UPS).
It works fine if I add these numbers manually, using "Or" and creating a new condition for each code. But I'd prefer not to have 120 conditions for flat rate, and the same 120 conditions negated for UPS (especially since these codes occasionally change).
Sorry if this is more of a rules question, but is there any way to use multiple values within one condition? I'm not a php expert, but can php be used to insert an array of values that will make this work?
Thanks!
Comments
Thank you so much for your help, magalie. Though I don't quite understand yet.
So in the rule, would I have two conditions – the first a text comparison and the second an order address comparison? Then I would reference the text comparison with the order address comparison?
I tried to set up a text comparison condition, but can't figure out which data selector to use. Once that's set up, I'm not sure how I would reference those text values in the order address comparison.
Thanks again so much for your help, and sorry if I'm muddying the waters – this sounds like the way to go.
Thanks so much! This is very helpful. I don't totally understand how to do this, but I understand the concept, and this is just the direction I needed to figure it out.