Personalized checkout and custom promotions with Shopify Scripts
Based on the answers to setting currency using geolocation, I have added
<script>
if (customer.default_address.country_code === 'CA') {
$("#currencies").val("CAD");
$("#currencies").change();
}
else {
$("#currencies").val("USD");
$("#currencies").change();
}
</script>
Just before the end end tag for body in the theme.liquid file. The site is set up to force a login, so the customer object exists before getting here. However, the currency does not change as expected. What am I missing?
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025