window.Shopify.settings is undefined. How do I access Shopify theme settings in JavaScript?

26 views Asked by At

I get undefined error when I try to use window.Shopify.settings.

Another approach I took was to use {{ settings.setting_id }}. In this case, {{ settings.setting_id }} is within a script tag in the theme.liquid file.

The second approach works but it doesn't always update the values on page reload. Therfore, I have to hard code values which isn't ideal.

0

There are 0 answers