You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snipcart creates and destroys itself on clicking the "add to cart" button, so on page load the cart is not existant until you interact with it. Which means any alpine inside my snipcart template wouldn't exist on initial page load. You can see this happen when you inspect the demo, the <div id="snipcart"> at the bottom of the page is empty until you click add to cart.
Wondering if this is why alpine is only partially working inside snipcart.
I'm testing with snippets from the alpine docs, some things seem to work and others don't...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to figure out why alpine doesn't work inside a Snipcart custom template.
https://docs.snipcart.com/v3/ ... https://demo.snipcart.com/
Snipcart creates and destroys itself on clicking the "add to cart" button, so on page load the cart is not existant until you interact with it. Which means any alpine inside my snipcart template wouldn't exist on initial page load. You can see this happen when you inspect the demo, the
<div id="snipcart">
at the bottom of the page is empty until you click add to cart.Wondering if this is why alpine is only partially working inside snipcart.
I'm testing with snippets from the alpine docs, some things seem to work and others don't...
This works:
But this doesn't work (if I set open to true 'content' becomes visible, but either way the click interaction doesn't work):
this works:
This doesn't work:
Beta Was this translation helpful? Give feedback.
All reactions