@liquidcommerce/elements-sdk 2.2.0-beta.23 → 2.2.0-beta.25

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
@@ -961,13 +961,12 @@ const client = await Elements('YOUR_API_KEY', {
961
961
  }
962
962
  },
963
963
  layout: {
964
- enablePersonalization: true,
965
- personalizationText: 'Customize your product',
966
- personalizationCardStyle: 'outlined',
967
- allowPromoCodes: true,
968
- inputFieldStyle: 'outlined',
969
- showPoweredBy: false,
970
- poweredByMode: 'light'
964
+ enablePersonalization: true,
965
+ personalizationText: 'Customize your product',
966
+ personalizationCardStyle: 'outlined',
967
+ allowPromoCodes: true,
968
+ inputFieldStyle: 'outlined',
969
+ poweredByMode: 'light'
971
970
  }
972
971
  }
973
972
  }
@@ -1100,21 +1099,79 @@ client.builder.updateAddressComponent({
1100
1099
 
1101
1100
  ## 🎁 Features Deep Dive
1102
1101
 
1103
- ### Product Engraving
1102
+ ### Product Personalization (Engraving)
1103
+
1104
+ The SDK provides a comprehensive personalization/engraving feature for products that support it. The personalization experience varies based on context:
1104
1105
 
1105
- Engraving is automatically enabled for products that support it:
1106
+ #### Product View
1107
+ When browsing products, customers can add personalization through an enhanced form that includes:
1108
+ - Product information with pricing
1109
+ - Fulfillment/retailer selection (with pricing comparison)
1110
+ - Multi-line engraving inputs with character limits
1111
+ - Real-time price updates as customers select different retailers
1112
+ - Add-to-cart with personalization in one step
1106
1113
 
1107
1114
  ```js
1108
- // Engraving appears automatically for engravable products
1115
+ // Personalization appears automatically for engravable products
1116
+ // Customers can add engraving text and select which retailer to fulfill from
1117
+
1118
+ // Listen for when personalization is added via add-to-cart
1119
+ window.addEventListener('lce:actions.product_add_to_cart', (event) => {
1120
+ const { hasEngraving, engravingLines } = event.detail.data;
1121
+ if (hasEngraving) {
1122
+ console.log('Customer personalized:', engravingLines);
1123
+ }
1124
+ });
1125
+ ```
1126
+
1127
+ #### Cart View
1128
+ In the cart, personalized items display:
1129
+ - Personalization text lines
1130
+ - Engraving fee (per item and total for quantity)
1131
+ - **Edit** button to modify the personalization
1132
+ - **Remove** button to remove personalization
1109
1133
 
1110
- // Listen for engraving updates
1111
- window.addEventListener('lce:actions.product_engraving_updated', (event) => {
1112
- const { productId, engravingLines } = event.detail.data;
1113
- console.log('Customer wants:', engravingLines);
1134
+ ```js
1135
+ // Customers can edit or remove engraving from cart items
1136
+ window.addEventListener('lce:actions.cart_item_engraving_updated', (event) => {
1137
+ const { identifier, engravingLines } = event.detail.data;
1138
+ console.log('Cart item engraving updated:', engravingLines);
1114
1139
  });
1115
1140
  ```
1116
1141
 
1117
- Engraving input appears automatically for products that support it.
1142
+ #### Checkout View
1143
+ During checkout, personalized items show:
1144
+ - Personalization text lines (read-only)
1145
+ - Engraving fee included in pricing
1146
+ - **Remove** button only (editing not allowed in checkout)
1147
+
1148
+ **Design Decision:** Editing personalization during checkout is intentionally disabled to prevent order processing complications. Customers must return to the cart to make changes.
1149
+
1150
+ #### Theming & Configuration
1151
+
1152
+ Control personalization display through global configuration:
1153
+
1154
+ ```js
1155
+ customTheme: {
1156
+ global: {
1157
+ layout: {
1158
+ enablePersonalization: true,
1159
+ personalizationText: 'Personalize your product',
1160
+ personalizationCardStyle: 'outlined' // or 'filled'
1161
+ }
1162
+ }
1163
+ }
1164
+ ```
1165
+
1166
+ #### Key Features
1167
+ - **Smart pricing:** Automatically includes engraving fees in product price
1168
+ - **Retailer selection:** Compare prices from different retailers during personalization
1169
+ - **Character limits:** Enforces maximum characters per line
1170
+ - **Uppercase conversion:** Engraving text is automatically converted to uppercase
1171
+ - **Multi-line support:** Products can support 1 or more engraving lines
1172
+ - **Fee transparency:** Shows per-item and total fees (e.g., "$5.00 ($2.50 ea)")
1173
+
1174
+ **Note:** Personalization is automatically enabled for products that support it. The SDK handles all UI, validation, and state management.
1118
1175
 
1119
1176
  ### Gift Options
1120
1177