Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • To connect your feed to your cart, you’ll need to add the Product ID field that your website’s add to cart is using to map to your preezie database attributes. This is the join between the results and your website’s cart. Please get in touch with support@preezie.com to help you with the steps below

  • Now you have added a new product field you need to re-run your feed (or wait for it to run automatically) for each product to propagate the Shopify Product ID value into prz_addToCartId

...

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 with your own custom add to cart events that your platform uses.

The event param requires 2 variables to be passed,

  • id: the exact product variant

...

  • id that will be added to the cart, note this needs to match the id passed to prz_addToCartId as above

  • quantity: the quantity that is being passed, i.e. 1

Code Block
languagejs
setTimeout(() => {

  const przWidget = document.getElementsByClassName('preezie-widget-app')[0]

  if(przWidget) {

    przWidget.addEventListener('przAddToCartEvent', (event) => {

        // event: { detail: { id: '125173761', quantity: 1 } }

        // add your custom "add to cart" events here

    })

  }          

}, 2000);

...