@liquidcommerce/elements-sdk 2.6.0-beta.64 → 2.6.0-beta.66
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/dist/index.checkout.esm.js +6924 -6923
- package/dist/index.esm.js +11224 -11203
- package/dist/types/interfaces/api/product.interface.d.ts +1 -0
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +1 -0
- package/docs/v1/api/actions/checkout-actions.md +40 -0
- package/docs/v1/api/actions/product-actions.md +44 -1
- package/docs/v1/api/client.md +13 -0
- package/docs/v1/api/configuration.md +528 -1
- package/docs/v1/api/injection-methods.md +18 -4
- package/docs/v1/api/typescript-types.md +398 -1
- package/docs/v1/examples/advanced-patterns.md +102 -0
- package/docs/v1/guides/best-practices.md +29 -0
- package/docs/v1/guides/product-list-component.md +70 -161
- package/docs/v1/reference/troubleshooting.md +64 -0
- package/package.json +4 -8
|
@@ -21,6 +21,7 @@ export declare class ProductAddToCartSectionComponent extends BaseComponent<IAdd
|
|
|
21
21
|
private calculateTotalPrice;
|
|
22
22
|
private createQuantityContainer;
|
|
23
23
|
private getSizeAttributes;
|
|
24
|
+
private openEngravingForm;
|
|
24
25
|
private isPresaleActive;
|
|
25
26
|
private createAddToCartButton;
|
|
26
27
|
protected template(): HTMLElement[] | string;
|
|
@@ -72,6 +72,25 @@ await window.LiquidCommerce.elements.actions.checkout.addProduct([
|
|
|
72
72
|
], true); // Open checkout after adding
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
### actions.checkout.addAnonymousProduct()
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
addAnonymousProduct(
|
|
79
|
+
params: IAnonymousCheckoutAddProductParams
|
|
80
|
+
): Promise<IAnonymousCheckoutAddProductResponse>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Add a product to checkout without requiring a cart session. Used for direct-to-checkout flows.
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
const result = await window.LiquidCommerce.elements.actions.checkout
|
|
87
|
+
.addAnonymousProduct({
|
|
88
|
+
identifier: '00619947000020',
|
|
89
|
+
fulfillmentType: 'shipping',
|
|
90
|
+
quantity: 1
|
|
91
|
+
});
|
|
92
|
+
```
|
|
93
|
+
|
|
75
94
|
## Promo & Gift Card Actions
|
|
76
95
|
|
|
77
96
|
### actions.checkout.applyPromoCode()
|
|
@@ -299,6 +318,27 @@ interface ICheckoutDetailsEventData {
|
|
|
299
318
|
}
|
|
300
319
|
```
|
|
301
320
|
|
|
321
|
+
### actions.checkout.getProductAvailabilityByState()
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
getProductAvailabilityByState(
|
|
325
|
+
identifiers: string[],
|
|
326
|
+
state?: string
|
|
327
|
+
): Promise<IProductAvailabilityResponse>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Check product availability across states from the checkout context.
|
|
331
|
+
|
|
332
|
+
```javascript
|
|
333
|
+
const availability = await window.LiquidCommerce.elements.actions.checkout
|
|
334
|
+
.getProductAvailabilityByState(['00619947000020'], 'CA');
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
| Parameter | Type | Required | Description |
|
|
338
|
+
|---------------|----------|----------|--------------------------------------|
|
|
339
|
+
| `identifiers` | string[] | Yes | Array of product UPCs, SKUs, or IDs |
|
|
340
|
+
| `state` | string | No | Two-letter state code (e.g., `'NY'`) |
|
|
341
|
+
|
|
302
342
|
## Use Cases
|
|
303
343
|
|
|
304
344
|
### Pre-fill for Logged-In Users
|
|
@@ -102,10 +102,53 @@ if (product1.price < product2.price) {
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## actions.product.getProductAvailabilityByState()
|
|
108
|
+
|
|
109
|
+
Check product availability across states.
|
|
110
|
+
|
|
111
|
+
### Signature
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
getProductAvailabilityByState(
|
|
115
|
+
identifiers: string[],
|
|
116
|
+
state?: string
|
|
117
|
+
): Promise<IProductAvailabilityResponse>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Parameters
|
|
121
|
+
|
|
122
|
+
| Parameter | Type | Required | Description |
|
|
123
|
+
|---------------|----------|----------|------------------------------------------|
|
|
124
|
+
| `identifiers` | string[] | Yes | Array of product UPCs, SKUs, or IDs |
|
|
125
|
+
| `state` | string | No | Two-letter state code (e.g., `'NY'`) |
|
|
126
|
+
|
|
127
|
+
### Example
|
|
128
|
+
|
|
129
|
+
```javascript
|
|
130
|
+
// Check availability in a specific state
|
|
131
|
+
const availability = await window.LiquidCommerce.elements.actions.product
|
|
132
|
+
.getProductAvailabilityByState(['00619947000020', '08504405135'], 'CA');
|
|
133
|
+
|
|
134
|
+
// Check availability in the user's current state (uses address if set)
|
|
135
|
+
const availability = await window.LiquidCommerce.elements.actions.product
|
|
136
|
+
.getProductAvailabilityByState(['00619947000020']);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Errors
|
|
140
|
+
|
|
141
|
+
**Throws `SDKError` if:**
|
|
142
|
+
- No identifiers provided or array is empty
|
|
143
|
+
- API request fails
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
105
147
|
## Notes
|
|
106
148
|
|
|
107
149
|
- Product must be injected and loaded before calling `getDetails()`
|
|
108
|
-
-
|
|
150
|
+
- `getDetails()` is synchronous - returns immediately
|
|
151
|
+
- `getProductAvailabilityByState()` is async - returns a Promise
|
|
109
152
|
- Prices are always in cents (divide by 100 for dollars)
|
|
110
153
|
- Selected values reflect current user selection in the component
|
|
111
154
|
|
package/docs/v1/api/client.md
CHANGED
|
@@ -112,6 +112,7 @@ interface IClientCustomThemeConfig {
|
|
|
112
112
|
address?: UpdateAddressComponent;
|
|
113
113
|
cart?: UpdateCartComponent;
|
|
114
114
|
checkout?: UpdateCheckoutComponent;
|
|
115
|
+
productList?: UpdateProductListComponent;
|
|
115
116
|
}
|
|
116
117
|
```
|
|
117
118
|
|
|
@@ -260,6 +261,9 @@ interface ILiquidCommerceElementsClient {
|
|
|
260
261
|
|
|
261
262
|
// Component management
|
|
262
263
|
getInjectedComponents(): Map<string, IInjectedComponent>;
|
|
264
|
+
|
|
265
|
+
// Cleanup
|
|
266
|
+
destroy(): void;
|
|
263
267
|
}
|
|
264
268
|
```
|
|
265
269
|
|
|
@@ -308,6 +312,15 @@ const productComponent = components.get('product-1');
|
|
|
308
312
|
productComponent.getType(); // 'product'
|
|
309
313
|
productComponent.getElement(); // <div id="product-1">...</div>
|
|
310
314
|
productComponent.rerender(); // Force rerender
|
|
315
|
+
productComponent.destroy(); // Remove from DOM and clean up
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### destroy()
|
|
319
|
+
|
|
320
|
+
Remove the client and all injected components, cleaning up event listeners and internal state.
|
|
321
|
+
|
|
322
|
+
```javascript
|
|
323
|
+
client.destroy();
|
|
311
324
|
```
|
|
312
325
|
|
|
313
326
|
## Error Handling
|
|
@@ -1 +1,528 @@
|
|
|
1
|
-
|
|
1
|
+
# Configuration Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for all configuration options available in the Elements SDK.
|
|
4
|
+
|
|
5
|
+
## Client Configuration
|
|
6
|
+
|
|
7
|
+
### ILiquidCommerceElementsConfig
|
|
8
|
+
|
|
9
|
+
Top-level configuration passed to `Elements()` or `ElementsBuilder()`.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
interface ILiquidCommerceElementsConfig {
|
|
13
|
+
env?: ElementsEnv;
|
|
14
|
+
promoTicker?: IPromoTicker[];
|
|
15
|
+
customTheme?: IClientCustomThemeConfig;
|
|
16
|
+
debugMode?: DebugMode;
|
|
17
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
18
|
+
proxy?: IElementsProxyConfig;
|
|
19
|
+
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| Property | Type | Required | Description |
|
|
24
|
+
|----------|------|----------|-------------|
|
|
25
|
+
| `env` | `'development' \| 'staging' \| 'production'` | No | API environment |
|
|
26
|
+
| `promoTicker` | `IPromoTicker[]` | No | Promotional ticker configurations |
|
|
27
|
+
| `customTheme` | `IClientCustomThemeConfig` | No | Theme overrides for all components |
|
|
28
|
+
| `debugMode` | `'none' \| 'console' \| 'panel'` | No | Debug output mode |
|
|
29
|
+
| `checkout` | `ILiquidCommerceElementsCheckoutConfig` | No | Checkout behavior settings |
|
|
30
|
+
| `proxy` | `IElementsProxyConfig` | No | Proxy configuration for API requests |
|
|
31
|
+
| `development` | `ILiquidCommerceElementsDevelopmentConfig` | No | Development/testing options |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Theme Configuration
|
|
36
|
+
|
|
37
|
+
### IClientCustomThemeConfig
|
|
38
|
+
|
|
39
|
+
Override default theme settings for any component.
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
interface IClientCustomThemeConfig {
|
|
43
|
+
global?: UpdateComponentGlobalConfigs;
|
|
44
|
+
product?: UpdateProductComponent;
|
|
45
|
+
address?: UpdateAddressComponent;
|
|
46
|
+
cart?: UpdateCartComponent;
|
|
47
|
+
checkout?: UpdateCheckoutComponent;
|
|
48
|
+
productList?: UpdateProductListComponent;
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
All theme properties are deeply partial -- you only need to specify the values you want to override.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Global Theme
|
|
57
|
+
|
|
58
|
+
#### IGlobalTheme
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
interface IGlobalTheme {
|
|
62
|
+
buttonCornerRadius: string;
|
|
63
|
+
cardCornerRadius: string;
|
|
64
|
+
headingFont: IFontFamily;
|
|
65
|
+
paragraphFont: IFontFamily;
|
|
66
|
+
primaryColor: string;
|
|
67
|
+
accentColor: string;
|
|
68
|
+
defaultTextColor: string;
|
|
69
|
+
selectedTextColor: string;
|
|
70
|
+
linkTextColor: string;
|
|
71
|
+
errorColor: string;
|
|
72
|
+
warningColor: string;
|
|
73
|
+
successColor: string;
|
|
74
|
+
drawerBackgroundColor: string;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
| Property | Type | Description |
|
|
79
|
+
|----------|------|-------------|
|
|
80
|
+
| `buttonCornerRadius` | `string` | CSS border-radius for buttons (e.g., `'8px'`) |
|
|
81
|
+
| `cardCornerRadius` | `string` | CSS border-radius for cards |
|
|
82
|
+
| `headingFont` | `IFontFamily` | Font family and weights for headings |
|
|
83
|
+
| `paragraphFont` | `IFontFamily` | Font family and weights for body text |
|
|
84
|
+
| `primaryColor` | `string` | Primary brand color (buttons, links, highlights) |
|
|
85
|
+
| `accentColor` | `string` | Secondary accent color |
|
|
86
|
+
| `defaultTextColor` | `string` | Default text color |
|
|
87
|
+
| `selectedTextColor` | `string` | Text color for selected/active elements |
|
|
88
|
+
| `linkTextColor` | `string` | Color for links |
|
|
89
|
+
| `errorColor` | `string` | Color for error states |
|
|
90
|
+
| `warningColor` | `string` | Color for warning states |
|
|
91
|
+
| `successColor` | `string` | Color for success states |
|
|
92
|
+
| `drawerBackgroundColor` | `string` | Background color for drawer components |
|
|
93
|
+
|
|
94
|
+
#### IFontFamily
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
interface IFontFamily {
|
|
98
|
+
name: string; // Google Font name (e.g., 'Inter')
|
|
99
|
+
weights: number[]; // Font weights to load (e.g., [400, 500, 700])
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### IGlobalLayout
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
interface IGlobalLayout {
|
|
107
|
+
enablePersonalization: boolean;
|
|
108
|
+
personalizationText: string;
|
|
109
|
+
personalizationCardStyle: 'outlined' | 'filled';
|
|
110
|
+
allowPromoCodes: boolean;
|
|
111
|
+
inputFieldStyle: 'outlined' | 'filled';
|
|
112
|
+
showPoweredBy: boolean;
|
|
113
|
+
poweredByMode: 'light' | 'dark';
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Property | Type | Description |
|
|
118
|
+
|----------|------|-------------|
|
|
119
|
+
| `enablePersonalization` | `boolean` | Enable engraving/personalization features |
|
|
120
|
+
| `personalizationText` | `string` | Label text for personalization option |
|
|
121
|
+
| `personalizationCardStyle` | `'outlined' \| 'filled'` | Visual style for personalization cards |
|
|
122
|
+
| `allowPromoCodes` | `boolean` | Show promo code inputs in cart/checkout |
|
|
123
|
+
| `inputFieldStyle` | `'outlined' \| 'filled'` | Visual style for input fields |
|
|
124
|
+
| `showPoweredBy` | `boolean` | Show "Powered by LiquidCommerce" badge |
|
|
125
|
+
| `poweredByMode` | `'light' \| 'dark'` | Color mode for the powered-by badge |
|
|
126
|
+
|
|
127
|
+
**Example:**
|
|
128
|
+
|
|
129
|
+
```javascript
|
|
130
|
+
customTheme: {
|
|
131
|
+
global: {
|
|
132
|
+
theme: {
|
|
133
|
+
primaryColor: '#007bff',
|
|
134
|
+
buttonCornerRadius: '8px',
|
|
135
|
+
headingFont: { name: 'Inter', weights: [400, 600, 700] }
|
|
136
|
+
},
|
|
137
|
+
layout: {
|
|
138
|
+
allowPromoCodes: true,
|
|
139
|
+
inputFieldStyle: 'outlined'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### Product Theme
|
|
148
|
+
|
|
149
|
+
#### IProductComponent
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
interface IProductComponent {
|
|
153
|
+
theme: IProductTheme;
|
|
154
|
+
layout: IProductLayout;
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### IProductTheme
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
interface IProductTheme {
|
|
162
|
+
backgroundColor: string;
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### IProductLayout
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
interface IProductLayout {
|
|
170
|
+
showImages: boolean;
|
|
171
|
+
showOnlyMainImage: boolean;
|
|
172
|
+
showTitle: boolean;
|
|
173
|
+
showDescription: boolean;
|
|
174
|
+
showQuantityCounter: boolean;
|
|
175
|
+
showOffHours: boolean;
|
|
176
|
+
quantityCounterStyle: 'outlined' | 'ghost';
|
|
177
|
+
fulfillmentDisplay: 'carousel' | 'popup';
|
|
178
|
+
enableShippingFulfillment: boolean;
|
|
179
|
+
enableOnDemandFulfillment: boolean;
|
|
180
|
+
addToCartButtonText: string;
|
|
181
|
+
addToCartButtonShowTotalPrice: boolean;
|
|
182
|
+
buyNowButtonText: string;
|
|
183
|
+
preSaleButtonText: string;
|
|
184
|
+
prioritizeEngraving: boolean;
|
|
185
|
+
noAvailabilityText: string;
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
| Property | Type | Description |
|
|
190
|
+
|----------|------|-------------|
|
|
191
|
+
| `showImages` | `boolean` | Show product image carousel |
|
|
192
|
+
| `showOnlyMainImage` | `boolean` | Show only the main product image (no carousel) |
|
|
193
|
+
| `showTitle` | `boolean` | Show product title |
|
|
194
|
+
| `showDescription` | `boolean` | Show product description |
|
|
195
|
+
| `showQuantityCounter` | `boolean` | Show quantity selector |
|
|
196
|
+
| `showOffHours` | `boolean` | Show off-hours messaging |
|
|
197
|
+
| `quantityCounterStyle` | `'outlined' \| 'ghost'` | Visual style for quantity counter |
|
|
198
|
+
| `fulfillmentDisplay` | `'carousel' \| 'popup'` | How to display fulfillment/retailer options |
|
|
199
|
+
| `enableShippingFulfillment` | `boolean` | Enable shipping fulfillment option |
|
|
200
|
+
| `enableOnDemandFulfillment` | `boolean` | Enable on-demand delivery option |
|
|
201
|
+
| `addToCartButtonText` | `string` | Custom text for add-to-cart button |
|
|
202
|
+
| `addToCartButtonShowTotalPrice` | `boolean` | Show total price on add-to-cart button |
|
|
203
|
+
| `buyNowButtonText` | `string` | Custom text for buy-now button |
|
|
204
|
+
| `preSaleButtonText` | `string` | Custom text for pre-sale button |
|
|
205
|
+
| `prioritizeEngraving` | `boolean` | Show engraving option before add-to-cart |
|
|
206
|
+
| `noAvailabilityText` | `string` | Text shown when product is unavailable |
|
|
207
|
+
|
|
208
|
+
**Example:**
|
|
209
|
+
|
|
210
|
+
```javascript
|
|
211
|
+
customTheme: {
|
|
212
|
+
product: {
|
|
213
|
+
layout: {
|
|
214
|
+
fulfillmentDisplay: 'popup',
|
|
215
|
+
addToCartButtonText: 'Add to Bag',
|
|
216
|
+
showQuantityCounter: true
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
### Cart Theme
|
|
225
|
+
|
|
226
|
+
#### ICartComponent
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
interface ICartComponent {
|
|
230
|
+
theme: ICartTheme;
|
|
231
|
+
layout: ICartLayout;
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### ICartTheme
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
interface ICartTheme {
|
|
239
|
+
backgroundColor: string;
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
#### ICartLayout
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
interface ICartLayout {
|
|
247
|
+
showQuantityCounter: boolean;
|
|
248
|
+
quantityCounterStyle: 'outlined' | 'ghost';
|
|
249
|
+
drawerHeaderText: string;
|
|
250
|
+
goToCheckoutButtonText: string;
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
| Property | Type | Description |
|
|
255
|
+
|----------|------|-------------|
|
|
256
|
+
| `showQuantityCounter` | `boolean` | Show quantity counter in cart items |
|
|
257
|
+
| `quantityCounterStyle` | `'outlined' \| 'ghost'` | Visual style for quantity counter |
|
|
258
|
+
| `drawerHeaderText` | `string` | Header text for the cart drawer |
|
|
259
|
+
| `goToCheckoutButtonText` | `string` | Custom text for checkout button |
|
|
260
|
+
|
|
261
|
+
**Example:**
|
|
262
|
+
|
|
263
|
+
```javascript
|
|
264
|
+
customTheme: {
|
|
265
|
+
cart: {
|
|
266
|
+
theme: { backgroundColor: '#f8f9fa' },
|
|
267
|
+
layout: {
|
|
268
|
+
drawerHeaderText: 'Your Bag',
|
|
269
|
+
goToCheckoutButtonText: 'Proceed to Checkout'
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### Checkout Theme
|
|
278
|
+
|
|
279
|
+
#### ICheckoutComponent
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
interface ICheckoutComponent {
|
|
283
|
+
theme: ICheckoutTheme;
|
|
284
|
+
layout: ICheckoutLayout;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
#### ICheckoutTheme
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
interface ICheckoutTheme {
|
|
292
|
+
backgroundColor: string;
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### ICheckoutLayout
|
|
297
|
+
|
|
298
|
+
```typescript
|
|
299
|
+
interface ICheckoutLayout {
|
|
300
|
+
emailOptIn: ICheckoutMarketingOptIn;
|
|
301
|
+
smsOptIn: ICheckoutMarketingOptIn;
|
|
302
|
+
allowGiftCards: boolean;
|
|
303
|
+
legalMessage: ICheckoutLegalMessage;
|
|
304
|
+
continueShoppingUrl: string;
|
|
305
|
+
exitUrl: string;
|
|
306
|
+
thankYouButtonText: string;
|
|
307
|
+
drawerHeaderText: string;
|
|
308
|
+
placeOrderButtonText: string;
|
|
309
|
+
checkoutCompleted: ICheckoutCompleted;
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
| Property | Type | Description |
|
|
314
|
+
|----------|------|-------------|
|
|
315
|
+
| `emailOptIn` | `ICheckoutMarketingOptIn` | Email marketing opt-in configuration |
|
|
316
|
+
| `smsOptIn` | `ICheckoutMarketingOptIn` | SMS marketing opt-in configuration |
|
|
317
|
+
| `allowGiftCards` | `boolean` | Enable gift card payment option |
|
|
318
|
+
| `legalMessage` | `ICheckoutLegalMessage` | Legal/terms message configuration |
|
|
319
|
+
| `continueShoppingUrl` | `string` | URL for "Continue Shopping" link |
|
|
320
|
+
| `exitUrl` | `string` | URL for exit/back navigation |
|
|
321
|
+
| `thankYouButtonText` | `string` | Button text on order confirmation page |
|
|
322
|
+
| `drawerHeaderText` | `string` | Header text for checkout drawer |
|
|
323
|
+
| `placeOrderButtonText` | `string` | Custom text for place order button |
|
|
324
|
+
| `checkoutCompleted` | `ICheckoutCompleted` | Order confirmation page customization |
|
|
325
|
+
|
|
326
|
+
#### ICheckoutMarketingOptIn
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
interface ICheckoutMarketingOptIn {
|
|
330
|
+
show: boolean; // Show the opt-in checkbox
|
|
331
|
+
checked: boolean; // Default checked state
|
|
332
|
+
text: string; // Label text (supports rich HTML)
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### ICheckoutLegalMessage
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
interface ICheckoutLegalMessage {
|
|
340
|
+
show: boolean; // Show the legal message
|
|
341
|
+
text: string; // Message content (supports rich HTML)
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
#### ICheckoutCompleted
|
|
346
|
+
|
|
347
|
+
```typescript
|
|
348
|
+
interface ICheckoutCompleted {
|
|
349
|
+
customLogo: string; // URL to custom logo image
|
|
350
|
+
customText: string | null; // Custom confirmation text
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Example:**
|
|
355
|
+
|
|
356
|
+
```javascript
|
|
357
|
+
customTheme: {
|
|
358
|
+
checkout: {
|
|
359
|
+
layout: {
|
|
360
|
+
placeOrderButtonText: 'Complete Purchase',
|
|
361
|
+
emailOptIn: { show: true, checked: false, text: 'Subscribe to our newsletter' },
|
|
362
|
+
legalMessage: { show: true, text: 'By placing this order, you agree to our <a href="/terms">Terms</a>.' }
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
### Address Theme
|
|
371
|
+
|
|
372
|
+
#### IAddressComponent
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
interface IAddressComponent {
|
|
376
|
+
theme: IAddressTheme;
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### IAddressTheme
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
interface IAddressTheme {
|
|
384
|
+
backgroundColor: string;
|
|
385
|
+
}
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
### Product List Theme
|
|
391
|
+
|
|
392
|
+
#### IProductListComponent
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
interface IProductListComponent {
|
|
396
|
+
theme: IProductListTheme;
|
|
397
|
+
layout: IProductListLayout;
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Product list theme updates use a special structure where lists are keyed by slug:
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
interface UpdateProductListComponent {
|
|
405
|
+
theme?: { backgroundColor?: string };
|
|
406
|
+
layout?: {
|
|
407
|
+
lists?: Record<string, DeepPartial<IPLCList>>;
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**Example:**
|
|
413
|
+
|
|
414
|
+
```javascript
|
|
415
|
+
customTheme: {
|
|
416
|
+
productList: {
|
|
417
|
+
theme: { backgroundColor: '#ffffff' },
|
|
418
|
+
layout: {
|
|
419
|
+
lists: {
|
|
420
|
+
'best-sellers': {
|
|
421
|
+
productCard: {
|
|
422
|
+
style: 'card',
|
|
423
|
+
showPrice: true,
|
|
424
|
+
enablePreCart: true
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
---
|
|
434
|
+
|
|
435
|
+
## Promo Ticker Configuration
|
|
436
|
+
|
|
437
|
+
### IPromoTicker
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
interface IPromoTicker {
|
|
441
|
+
promoCode: string; // Promo code to auto-apply
|
|
442
|
+
text: string[]; // Array of messages to rotate
|
|
443
|
+
separator: string; // Separator between messages (e.g., '|')
|
|
444
|
+
activeFrom: string; // Start date in ISO 8601 UTC format
|
|
445
|
+
activeUntil: string; // End date in ISO 8601 UTC format
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Example:**
|
|
450
|
+
|
|
451
|
+
```javascript
|
|
452
|
+
promoTicker: [
|
|
453
|
+
{
|
|
454
|
+
promoCode: 'SUMMER20',
|
|
455
|
+
text: ['20% Off Summer Sale', 'Free Shipping on $50+'],
|
|
456
|
+
separator: '|',
|
|
457
|
+
activeFrom: '2026-06-01T00:00:00Z',
|
|
458
|
+
activeUntil: '2026-08-31T23:59:59Z'
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Checkout Configuration
|
|
466
|
+
|
|
467
|
+
### ILiquidCommerceElementsCheckoutConfig
|
|
468
|
+
|
|
469
|
+
```typescript
|
|
470
|
+
interface ILiquidCommerceElementsCheckoutConfig {
|
|
471
|
+
pageUrl?: string; // URL with {token} placeholder
|
|
472
|
+
}
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
When `pageUrl` is set, the cart's checkout button redirects to this URL instead of opening the checkout drawer. Use `{token}` as a placeholder for the checkout session token.
|
|
476
|
+
|
|
477
|
+
**Example:**
|
|
478
|
+
|
|
479
|
+
```javascript
|
|
480
|
+
checkout: {
|
|
481
|
+
pageUrl: 'https://yoursite.com/checkout?lce_checkout={token}'
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Proxy Configuration
|
|
488
|
+
|
|
489
|
+
### IElementsProxyConfig
|
|
490
|
+
|
|
491
|
+
```typescript
|
|
492
|
+
interface IElementsProxyConfig {
|
|
493
|
+
baseUrl: string;
|
|
494
|
+
headers?: Record<string, string>;
|
|
495
|
+
}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
Route SDK API requests through your own server to avoid ad blockers.
|
|
499
|
+
|
|
500
|
+
See [Proxy Setup Guide](../integration/proxy-setup.md) for implementation details.
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## Development Configuration
|
|
505
|
+
|
|
506
|
+
### ILiquidCommerceElementsDevelopmentConfig
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
interface ILiquidCommerceElementsDevelopmentConfig {
|
|
510
|
+
customApiUrl?: string;
|
|
511
|
+
paymentMethodId?: string;
|
|
512
|
+
openShadowDom?: boolean;
|
|
513
|
+
}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
| Property | Type | Description |
|
|
517
|
+
|----------|------|-------------|
|
|
518
|
+
| `customApiUrl` | `string` | Custom API URL for local or custom backend testing |
|
|
519
|
+
| `paymentMethodId` | `string` | Hardcoded Stripe payment method ID for automated testing |
|
|
520
|
+
| `openShadowDom` | `boolean` | Disable Shadow DOM isolation for debugging (default: `false`) |
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## See Also
|
|
525
|
+
|
|
526
|
+
- [Client API](./client.md) - Client initialization and usage
|
|
527
|
+
- [TypeScript Types](./typescript-types.md) - Complete type reference
|
|
528
|
+
- [Theming Guide](../guides/theming.md) - Theming best practices
|