Personalized checkout and custom promotions with Shopify Scripts
Hi,
I would like to translate the discount message in a Shopify Script.
Therefore I was thinking to make use of the Input.locale string.
Does anyone have an example of how to use this?
The locale can end with the country code so I wanted to take the first characters of the string, but this gets an undefined method []:
input_locale = Input.locale[0,2]
message_discount = "Free Coffee Gift"
if input_locale == "fr"
message_discount = "Cadeau de café gratuit"
end
The message doesn't even change when I change the code by a regular equation:
message_discount = "Cadeau de café gratuit"
if Input.locale == "en"
message_discount = "Free Coffee Gift"
end
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024