Personalized checkout and custom promotions with Shopify Scripts
Hi,
Adding the RegExp class to Shopify Scripts API would open up a lot of additional functionality in Shipping Script in particular that is currently either difficult or impossible to do with the existing API. For instance RegExp would allow for:
Right now the only string tests I'm aware of are ==, starts_with? and ends_with? which makes for difficulty in correctly testing the first use case mentioned above. Instead of
Input.cart.address1 =~ /^(p\.*o\.*|box)/i || Input.cart.address2 =~ /^(p\.*o\.*|box)/i
I have to generate all of the possible combinations of characters matching that RegExp (with something like https://github.com/teeshop/rexgen) and add them to an array to then test with .starts_with?. This is very hackey and could be easily resolved with assess to RexExp functionality builtin to the script API.
This would help solve the long standing PO box issue and other I'm sure as well. Please add RexExp to the list of available classes in the Shopify Script API. Thanks!
Cheers,
Brad
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024