Shipping Address Zip Returning FalseClasss

Solved
Shopify Partner
37 4 4

Hi,

 

I'm trying to test for the second character in a postal code being a '0' as this signifies that the destination is a rural address and due to some carriers charging exorbitant delivery fees for rural delivery we would like to remove those carriers as options for delivery.

 

The issue is that while the API doc says that the shipping_address.zip property is a string it is actually returning FalseClass.

 

Annotation 2020-03-09 134541.png

 

There is no RegExp test available either which is disappointing.

 

How can one test if the 2nd non-white space character is a '0' ?

 

Thanks!

0 Likes
Highlighted

Success.

Shopify Partner
37 4 4

The solution to get a String back is:

 

str = String(Input.cart.shipping_address.zip)
0 Likes