Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

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

florymory
Visitor
2 0 1

Hi,

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. Therefore, I have to hard code values which isn't ideal.

I have two questions.

How can I access the values in JavaScript.

If I access the values in liquid file, why don't they update when I change theme settings and reload the website page?

Thanks.

Replies 0 (0)