@constructor-io/constructorio-ui-plp 1.6.5 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,6 +50,34 @@ CioPlp({
50
50
  });
51
51
  ```
52
52
 
53
+ ### 🛍️ Shopify-Specific Defaults
54
+
55
+ When integrating with Shopify themes, you can use the `useShopifyDefaults` prop to enable Shopify-specific behavior:
56
+
57
+ ```jsx
58
+ <CioPlp apiKey='your-api-key' useShopifyDefaults={true} />
59
+ ```
60
+
61
+ **What it provides:**
62
+
63
+ - `callbacks.onAddToCart`: Adds products to the Shopify cart via `/cart/add.js` API
64
+ - `callbacks.onProductCardClick`: Navigates to `/products/{itemId}`
65
+ - `urlHelpers.setUrl`: Converts `/group_id/` URLs to `/collections/` for Shopify compatibility
66
+
67
+ **For the JavaScript Bundle:**
68
+
69
+ When using `useShopifyDefaults` with the bundled version, you can omit the `selector` parameter and it will default to `#cio-plp-ui-container`:
70
+
71
+ ```js
72
+ CioPlp({
73
+ apiKey: 'your-api-key',
74
+ useShopifyDefaults: true,
75
+ // selector defaults to '#cio-plp-ui-container'
76
+ });
77
+ ```
78
+
79
+ **Note:** Any custom `callbacks` or `urlHelpers` you provide will override the Shopify defaults.
80
+
53
81
  ## Custom Styling
54
82
 
55
83
  ### Library Defaults