How can I check if the cart drawer is open?
I need it for some logic in the drawer to be executed if the drawer is open/active.
I hope I can check it through liquid.
How can I check if the cart drawer is open?
I need it for some logic in the drawer to be executed if the drawer is open/active.
I hope I can check it through liquid.
Hey @PureTime
Share your store URL and Password (if enabled) and then I can show you the difference.
Best,
Moeed
Hi @PureTime ,
Can you describe in detail what logic do you want to apply? Also, please share the store URL.
you mean you need to check the option in your theme of drawer open? if yes you need to go theme > edit and search drawer than you will find that code if code exist than drawer option is there .
Shop is not even published. But I’ll just tap into the code in the cart-drawer.liquid.
Thanks
No, you can’t do this in Liquid.
Liquid rendering is finished when HTML file is served to the visitors browser.
Then, drawer functionality (including open/close) is done with Javascript.
In Liquid you can render both versions of page for both open and close and then use either CSS or JavaScript to show one or another based on drawer state.
Or move your logic to Javascript completely.
Need more details on what you’re trying to achieve.
The purpose did not require this afterall.
I just wanted to output some product delivery information about each item in the cart when the drawer was opened.
But I could just tap into the code to do this.
But thanks for all your answers.