Liquid, JavaScript, themes, sales channels
Hello!
Is there a way to access a javascript variable through liquid?
On the site I am working on, there is a featured collection in the homepage. This featured collection is changing from time to time. I want to track this collection, even if it's changing and I don't know what collection will be next.
I am able to track this changing from DOM, by using a javascript variable. I need to assign the output of this javascript variable to a liquid variable.
The output of the javascript variable tells me what the current featured collection is, and if the collection changes, the variable tells me what is the name of the updated collection.
I could use the output of this variable to tell the liquid code, that extracts collection data from the site collections, which collection is the current one, and pull data from that collection. This data will be then pushed to dataLayer.
Is there is a solution to this situation?
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024