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

florymory
Visitor
2 0 0

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)