Integration with wix-ecom-backend

Passing product details from the Stores catalog to a wix-ecom-backend cart, checkout, or order, must follow the structure of the catalogReference object.

  • catalogItemId - When passing Wix Stores products, this is the productId.
  • appId - The Stores app ID. When passing products from the Wix Stores catalog, this must always be "215238eb-22a5-4c36-9e7b-e7c08025e04e".
  • options - This field can hold different key:value pairs, depending on variant management and whether the product/variant has custom text fields.

Refer to the following catalogReference object examples for more details:

Managed Variants

When the inventory of a product's variants is managed (product.manageVariants: true), the catalogReference.options field should contain the variantId. In the following example, the variant also has customTextFields:

Copy

Non-Managed Variants

When the inventory of a product's variants is not managed (product.manageVariants: false), the catalogReference.options field should contain the variant's options and choices:

Copy

Velo Code Example

In this example, we add the following code in the Stores Product page that:

  • Uses $w.ProductPage and wix-ecom-backend.currentCart functions.
  • Gets the details of the product currently displayed in the Product Page.
  • Checks whether the product has managed variants.
  • Dynamically populates the catalogReference object based on the selected choices and quantity.
  • Adds the specific product/variant to the current cart.
Copy
Was this helpful?
Yes
No