Tags:
- Themes
Standard storefront events and actions
Liquid storefronts now have a standard communication layer between themes and the code that runs on them. Themes emit events, while apps and agents call actions.
Both work across all themes, and they ship together so you implement only once:
- Events are DOM events for commerce interactions:
shopify:product:view,shopify:cart:lines-update,shopify:search:update, and others. Theme developers implement these in their theme code. App developers subscribe with plain JavaScript and get payload data directly, no follow-up API call needed. - Actions go the other direction.
,, andare available on every Liquid storefront. Apps and agents call them to trigger theme behaviors. Out of the box, they hit the Storefront API and reload the page. Theme developers override them to skip the reload and handle the UI update directly. Actions also emit the corresponding event on success.
Read the documentation for more details.
Was this section helpful?