Cart Balancing/Normalization

A Stylux bundle generally consists of the "base" product, as well as the "upsell" product, which is used to control personalization pricing within the Stylux API. When adding a Stylux bundle to cart, it's important to add both the base product and upsell product (if it exists) with matching quantities.

This not only includes when the product is initially added to cart, but afterwards as well; e.g., if the end-consumer updates quantities or removes products from cart we need to ensure the associated upsell/base product is also updated to match. In other words, A Stylux personalized product as part of an order is only valid if both the base/upsell product have matching quantities (identified by a unique bundle ID).

SDK Automated Cart Balancing/Normalization

If you're using the Shopify plugin within the JavaScript SDK for regular/non-headless Shopify integrations, this is handled automatically for you out of the box by default.

To explicitly enable or disable this functionality you can initialize the JavaScript SDK as follows:

(async function () {
  if (!self.Stylux) {
    return;
  }

  await Stylux.setup({
    apiKey: 'STLX_key-for-unsigned-requests',
    merchantId: 'merchant-id',

    plugins: {
      shopify: {
        normalizeCart: true,
      },
    },
  });
})();