...
Add your custom code
Now the feature is on, each time the add to cart button is clicked a preezie custom event przAddToCartEvent
will fire. You then need to place this script on your pages to fire with your own custom add to cart events that your platform uses.
The event param requires the product variant as productId and the quantity of 1 to be passed to it.
Code Block | ||
---|---|---|
| ||
setTimeout(() => { const przWidget = document.getElementsByClassName('preezie-widget-app')[0] if(przWidget) { przWidget.addEventListener('przAddToCartEvent', (event) => { // event: { detail: { productId: productId || '', quantity: 1 } } // add your custom "add to cart" events here }) } }, 2000); |
...
You’re now ready to turn on and style your buttons, see the styling guide below.
...
Anchor | ||||
---|---|---|---|---|
|
...