Personalized checkout and custom promotions with Shopify Scripts
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.
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!
Solved! Go to the solution
This is an accepted solution.
The solution to get a String back is:
str = String(Input.cart.shipping_address.zip)
This is an accepted solution.
The solution to get a String back is:
str = String(Input.cart.shipping_address.zip)
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024