@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 +72 -15
- package/dist/index.esm.js +7602 -7850
- package/dist/types/core/command/common-command.service.d.ts +2 -0
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +2 -3
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -5
- package/dist/types/core/store/interfaces/product.interface.d.ts +0 -1
- package/dist/types/enums/core.enum.d.ts +0 -2
- package/dist/types/modules/cart/components/cart-item.component.d.ts +1 -6
- package/dist/types/modules/checkout/checkout.commands.d.ts +2 -1
- package/dist/types/modules/checkout/components/summary/checkout-item-quantity.component.d.ts +0 -2
- package/dist/types/modules/checkout/components/summary/checkout-item.component.d.ts +2 -1
- package/dist/types/modules/product/components/index.d.ts +1 -1
- package/dist/types/modules/product/product.commands.d.ts +0 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +13 -10
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +3 -9
- package/package.json +4 -7
- package/umd/elements.js +1 -1
- package/dist/types/modules/product/components/product-engraving.component.d.ts +0 -19
package/README.md
CHANGED
|
@@ -961,13 +961,12 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
961
961
|
}
|
|
962
962
|
},
|
|
963
963
|
layout: {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
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
|
-
|
|
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
|
|