@liquidcommerce/elements-sdk 2.6.0-beta.36 → 2.6.0-beta.38
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 +302 -71
- package/dist/index.checkout.esm.js +6234 -6238
- package/dist/index.esm.js +10909 -10897
- package/dist/types/constants/core.constant.d.ts +4 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +0 -2
- package/dist/types/interfaces/configs/product-list.interface.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +2 -1
- package/dist/types/modules/product-list/product-list.component.d.ts +2 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +2 -0
- package/docs/ACTIONS.md +1 -0
- package/docs/CONFIGURATION.md +178 -34
- package/docs/DOCUMENTATION_INDEX.md +12 -4
- package/docs/THEMING.md +107 -18
- package/package.json +1 -1
|
@@ -2,7 +2,6 @@ import type { IPagination } from 'modules/product-list/product-list.interface';
|
|
|
2
2
|
import type { FulfillmentType } from '@/enums';
|
|
3
3
|
import type { IFulfillment, IProduct, IProductVariant, IRetailer, IRetailerAddress } from '@/interfaces/api/product.interface';
|
|
4
4
|
import type { IFilterSchema } from '@/interfaces/api/product-list.interface';
|
|
5
|
-
import type { IModalStore } from './core.interface';
|
|
6
5
|
import type { IProductSizeStore } from './product.interface';
|
|
7
6
|
export type IProductFulfillmentStore = IFulfillment & {
|
|
8
7
|
retailerName: string;
|
|
@@ -40,7 +39,6 @@ export interface IProductListStore {
|
|
|
40
39
|
selectedFulfillmentType: FulfillmentType;
|
|
41
40
|
selectedFulfillment: IProductFulfillmentStore | null;
|
|
42
41
|
selectedQuantity: number;
|
|
43
|
-
modal: IModalStore;
|
|
44
42
|
};
|
|
45
43
|
};
|
|
46
44
|
loading: boolean;
|
|
@@ -4,6 +4,7 @@ export type ProductListCardCornerRadius = 'rounded' | 'sharp';
|
|
|
4
4
|
export interface IProductListTheme {
|
|
5
5
|
backgroundColor: string;
|
|
6
6
|
}
|
|
7
|
+
export type IDisplayMode = 'modal' | 'drawer';
|
|
7
8
|
export interface IProductListLayout {
|
|
8
9
|
productCard: {
|
|
9
10
|
style: ProductListCardStyle;
|
|
@@ -18,6 +19,7 @@ export interface IProductListLayout {
|
|
|
18
19
|
showCollections: boolean;
|
|
19
20
|
enablePersonalization: boolean;
|
|
20
21
|
};
|
|
22
|
+
displayMode: IDisplayMode;
|
|
21
23
|
}
|
|
22
24
|
export interface IProductListComponent {
|
|
23
25
|
theme: IProductListTheme;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
1
2
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
3
|
import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
|
|
3
|
-
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams> {
|
|
4
|
+
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
|
|
4
5
|
get hostClasses(): string[];
|
|
5
6
|
private createSkeletonCard;
|
|
6
7
|
protected template(): HTMLElement[];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { IProductListComponent } from 'interfaces/configs';
|
|
1
|
+
import type { IDisplayMode, IProductListComponent } from 'interfaces/configs';
|
|
2
2
|
import { BaseComponent } from '@/core/base-component.service';
|
|
3
3
|
export interface IProductListRetailersParams {
|
|
4
4
|
productId: string;
|
|
5
5
|
config?: IProductListComponent;
|
|
6
|
+
displayMode?: IDisplayMode;
|
|
6
7
|
}
|
|
7
8
|
export declare class ProductListRetailersComponent extends BaseComponent<IProductListRetailersParams, IProductListComponent> {
|
|
8
9
|
get hostClasses(): string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
1
2
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
3
|
import type { ProductListFilterType } from '@/interfaces/core.interface';
|
|
3
4
|
export interface IProductListComponentParams {
|
|
@@ -6,7 +7,7 @@ export interface IProductListComponentParams {
|
|
|
6
7
|
filters: ProductListFilterType[];
|
|
7
8
|
productUrl?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare class ProductListComponent extends BaseComponent<IProductListComponentParams> {
|
|
10
|
+
export declare class ProductListComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
|
|
10
11
|
private products;
|
|
11
12
|
private retailers;
|
|
12
13
|
private pagination;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { IDisplayMode } from '@/interfaces/configs';
|
|
2
3
|
export interface IEngravingFormComponentParams {
|
|
3
4
|
identifier: string;
|
|
4
5
|
context: 'product' | 'cart' | 'product-list';
|
|
@@ -7,6 +8,7 @@ export interface IEngravingFormComponentParams {
|
|
|
7
8
|
maxCharsPerLine: number;
|
|
8
9
|
fee: number;
|
|
9
10
|
location?: string;
|
|
11
|
+
displayMode?: IDisplayMode;
|
|
10
12
|
}
|
|
11
13
|
export declare class EngravingFormComponent extends BaseComponent<IEngravingFormComponentParams, null> {
|
|
12
14
|
get hostClasses(): string[];
|
package/docs/ACTIONS.md
CHANGED
|
@@ -524,6 +524,7 @@ await actions.cart.resetCart();
|
|
|
524
524
|
actions.checkout.openCheckout();
|
|
525
525
|
actions.checkout.closeCheckout();
|
|
526
526
|
actions.checkout.toggleCheckout();
|
|
527
|
+
actions.checkout.exitCheckout();
|
|
527
528
|
|
|
528
529
|
// Example: Open checkout automatically for high-value carts
|
|
529
530
|
const cart = actions.cart.getDetails();
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -11,7 +11,10 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
11
11
|
isBuilder: false,
|
|
12
12
|
customTheme: {},
|
|
13
13
|
proxy: {},
|
|
14
|
-
promoTicker: []
|
|
14
|
+
promoTicker: [],
|
|
15
|
+
checkout: {
|
|
16
|
+
pageUrl: 'https://yoursite.com/checkout?id={id}' // Optional: hosted checkout
|
|
17
|
+
}
|
|
15
18
|
});
|
|
16
19
|
```
|
|
17
20
|
|
|
@@ -262,6 +265,33 @@ activeUntil: '2025-12-31T23:59:59Z'
|
|
|
262
265
|
|
|
263
266
|
**Note:** Only active promotions are displayed.
|
|
264
267
|
|
|
268
|
+
### `checkout`
|
|
269
|
+
|
|
270
|
+
**Type:** `object`
|
|
271
|
+
**Default:** `undefined`
|
|
272
|
+
|
|
273
|
+
Configuration for hosted checkout (external checkout page).
|
|
274
|
+
|
|
275
|
+
```javascript
|
|
276
|
+
checkout: {
|
|
277
|
+
pageUrl: 'https://yoursite.com/checkout?id={id}'
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Properties:**
|
|
282
|
+
|
|
283
|
+
#### `checkout.pageUrl`
|
|
284
|
+
|
|
285
|
+
**Type:** `string` (required)
|
|
286
|
+
|
|
287
|
+
URL of your dedicated checkout page. The `{id}` placeholder is replaced with the checkout token.
|
|
288
|
+
|
|
289
|
+
```javascript
|
|
290
|
+
pageUrl: 'https://yoursite.com/checkout?id={id}'
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
When set, the "Go to Checkout" button in the cart redirects to this URL instead of opening the checkout drawer.
|
|
294
|
+
|
|
265
295
|
## Auto-Initialization Configuration
|
|
266
296
|
|
|
267
297
|
When using auto-initialization, configure via `data-` attributes on the script tag.
|
|
@@ -376,6 +406,28 @@ data-cart-badge-button="" <!-- Empty value = floating button w
|
|
|
376
406
|
- `replace:` - Replace the target element
|
|
377
407
|
- `inside:` - Place inside the target element (default)
|
|
378
408
|
|
|
409
|
+
#### `data-cart-mobile-button`
|
|
410
|
+
|
|
411
|
+
**Type:** `string`
|
|
412
|
+
|
|
413
|
+
Mobile-specific cart button (no badge). Same syntax as `data-cart-button` but only shown on mobile devices.
|
|
414
|
+
|
|
415
|
+
```html
|
|
416
|
+
data-cart-mobile-button="below:.mobile-header"
|
|
417
|
+
data-cart-mobile-button="inside:.mobile-nav"
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
#### `data-cart-mobile-badge-button`
|
|
421
|
+
|
|
422
|
+
**Type:** `string`
|
|
423
|
+
|
|
424
|
+
Mobile-specific cart button with item count badge. Same syntax as `data-cart-badge-button` but only shown on mobile devices.
|
|
425
|
+
|
|
426
|
+
```html
|
|
427
|
+
data-cart-mobile-badge-button="below:.mobile-header"
|
|
428
|
+
data-cart-mobile-badge-button="inside:.mobile-nav"
|
|
429
|
+
```
|
|
430
|
+
|
|
379
431
|
#### `data-cart-button-hidden`
|
|
380
432
|
|
|
381
433
|
**Type:** flag (no value)
|
|
@@ -517,11 +569,9 @@ data-product-2="00832889005513"
|
|
|
517
569
|
|
|
518
570
|
```html
|
|
519
571
|
<div data-liquid-commerce-elements-products-list
|
|
520
|
-
data-card="standard"
|
|
521
572
|
data-rows="3"
|
|
522
573
|
data-columns="4"
|
|
523
|
-
data-
|
|
524
|
-
data-filters="personalization,pre-order,delivery-options"
|
|
574
|
+
data-filters="engraving,presale,fulfillment,price,brands"
|
|
525
575
|
data-product-url="/product/{upc}">
|
|
526
576
|
</div>
|
|
527
577
|
```
|
|
@@ -534,23 +584,12 @@ data-product-2="00832889005513"
|
|
|
534
584
|
|
|
535
585
|
Enables product list on this div element.
|
|
536
586
|
|
|
537
|
-
##### `data-card`
|
|
538
|
-
|
|
539
|
-
**Type:** `'standard'`
|
|
540
|
-
**Default:** `'standard'`
|
|
541
|
-
|
|
542
|
-
Card variant style.
|
|
543
|
-
|
|
544
|
-
```html
|
|
545
|
-
data-card="standard"
|
|
546
|
-
```
|
|
547
|
-
|
|
548
587
|
##### `data-rows`
|
|
549
588
|
|
|
550
|
-
**Type:** `number`
|
|
589
|
+
**Type:** `number`
|
|
551
590
|
**Default:** `3`
|
|
552
591
|
|
|
553
|
-
Number of rows to display per page.
|
|
592
|
+
Number of rows to display per page (1-10).
|
|
554
593
|
|
|
555
594
|
```html
|
|
556
595
|
data-rows="4"
|
|
@@ -558,39 +597,40 @@ data-rows="4"
|
|
|
558
597
|
|
|
559
598
|
##### `data-columns`
|
|
560
599
|
|
|
561
|
-
**Type:** `number`
|
|
600
|
+
**Type:** `number`
|
|
562
601
|
**Default:** `4`
|
|
563
602
|
|
|
564
|
-
Number of columns in the grid.
|
|
603
|
+
Number of columns in the grid (1-4).
|
|
565
604
|
|
|
566
605
|
```html
|
|
567
606
|
data-columns="4"
|
|
568
607
|
```
|
|
569
608
|
|
|
570
|
-
##### `data-card-fill`
|
|
571
|
-
|
|
572
|
-
**Type:** flag (no value)
|
|
573
|
-
|
|
574
|
-
Whether cards should fill the whole card with white background color to match the image background color.
|
|
575
|
-
|
|
576
|
-
```html
|
|
577
|
-
data-card-fill
|
|
578
|
-
```
|
|
579
|
-
|
|
580
609
|
##### `data-filters`
|
|
581
610
|
|
|
582
611
|
**Type:** `string` (comma-separated)
|
|
583
612
|
|
|
584
|
-
Filter types to enable
|
|
613
|
+
Filter types to enable.
|
|
585
614
|
|
|
586
615
|
```html
|
|
587
|
-
data-filters="
|
|
616
|
+
data-filters="engraving,presale,fulfillment,price,brands"
|
|
588
617
|
```
|
|
589
618
|
|
|
590
619
|
**Available filters:**
|
|
591
|
-
- `
|
|
592
|
-
- `
|
|
593
|
-
- `
|
|
620
|
+
- `engraving` - Show filter for personalized/engravable products
|
|
621
|
+
- `presale` - Show filter for pre-order products
|
|
622
|
+
- `fulfillment` - Show filter for delivery type (shipping, onDemand)
|
|
623
|
+
- `price` - Show price range filter
|
|
624
|
+
- `brands` - Show brand filter
|
|
625
|
+
- `categories` - Show category filter
|
|
626
|
+
- `flavor` - Show flavor filter
|
|
627
|
+
- `region` - Show region filter
|
|
628
|
+
- `variety` - Show variety filter
|
|
629
|
+
- `vintage` - Show vintage year filter
|
|
630
|
+
- `country` - Show country filter
|
|
631
|
+
- `appellation` - Show appellation filter
|
|
632
|
+
- `materials` - Show materials filter
|
|
633
|
+
- `sizes` - Show size filter
|
|
594
634
|
|
|
595
635
|
##### `data-product-url`
|
|
596
636
|
|
|
@@ -607,6 +647,60 @@ data-product-url="/products/{grouping}"
|
|
|
607
647
|
- `{upc}` - Replaced with product UPC
|
|
608
648
|
- `{grouping}` - Replaced with Salsify grouping ID
|
|
609
649
|
|
|
650
|
+
### Product List Search and Filters Containers
|
|
651
|
+
|
|
652
|
+
You can place search and filter components in separate containers:
|
|
653
|
+
|
|
654
|
+
```html
|
|
655
|
+
<!-- Search bar (any div) -->
|
|
656
|
+
<div data-search-container></div>
|
|
657
|
+
|
|
658
|
+
<!-- Filter panel (any div) -->
|
|
659
|
+
<div data-filters-container></div>
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
These work alongside the main `data-liquid-commerce-elements-products-list` container. The search and filter components communicate with the product list automatically.
|
|
663
|
+
|
|
664
|
+
### Checkout URL Configuration
|
|
665
|
+
|
|
666
|
+
#### `data-checkout-url`
|
|
667
|
+
|
|
668
|
+
**Type:** `string`
|
|
669
|
+
|
|
670
|
+
URL for hosted checkout page. The `{id}` placeholder is replaced with the checkout token.
|
|
671
|
+
|
|
672
|
+
```html
|
|
673
|
+
data-checkout-url="https://yoursite.com/checkout?id={id}"
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
When set, the "Go to Checkout" button in the cart redirects to this URL instead of opening the checkout drawer.
|
|
677
|
+
|
|
678
|
+
### Custom Cart Elements
|
|
679
|
+
|
|
680
|
+
#### `data-lce-cart-toggle-button`
|
|
681
|
+
|
|
682
|
+
**Type:** flag (no value)
|
|
683
|
+
|
|
684
|
+
Add to any element to make it toggle the cart open/closed on click.
|
|
685
|
+
|
|
686
|
+
```html
|
|
687
|
+
<button data-lce-cart-toggle-button>Open Cart</button>
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
#### `data-lce-cart-items-count`
|
|
691
|
+
|
|
692
|
+
**Type:** `string` (optional value: `"keep-zero"`)
|
|
693
|
+
|
|
694
|
+
Displays the current cart item count inside the element. Updated automatically.
|
|
695
|
+
|
|
696
|
+
```html
|
|
697
|
+
<!-- Hides when count is 0 -->
|
|
698
|
+
<span data-lce-cart-items-count></span>
|
|
699
|
+
|
|
700
|
+
<!-- Always shows count, even when 0 -->
|
|
701
|
+
<span data-lce-cart-items-count="keep-zero">0</span>
|
|
702
|
+
```
|
|
703
|
+
|
|
610
704
|
### URL Parameter Configuration
|
|
611
705
|
|
|
612
706
|
#### `data-product-param`
|
|
@@ -692,6 +786,51 @@ data-promo-active-from="2025-01-01T00:00:00Z"
|
|
|
692
786
|
data-promo-active-until="2025-12-31T23:59:59Z"
|
|
693
787
|
```
|
|
694
788
|
|
|
789
|
+
## Checkout-Only Build (Hosted Checkout)
|
|
790
|
+
|
|
791
|
+
For hosted checkout pages, use the checkout-only build for a smaller bundle.
|
|
792
|
+
|
|
793
|
+
### Auto-Initialization
|
|
794
|
+
|
|
795
|
+
```html
|
|
796
|
+
<script
|
|
797
|
+
data-liquid-commerce-checkout
|
|
798
|
+
data-token="YOUR_API_KEY"
|
|
799
|
+
data-env="production"
|
|
800
|
+
data-debug-mode="none"
|
|
801
|
+
src="https://assets-elements.liquidcommerce.us/checkout/elements.js"
|
|
802
|
+
></script>
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
**Attributes:**
|
|
806
|
+
- `data-liquid-commerce-checkout` - Enables checkout-only auto-initialization (required)
|
|
807
|
+
- `data-token` - Your API key (required)
|
|
808
|
+
- `data-env` - Environment: `production`, `staging`, `development`
|
|
809
|
+
- `data-debug-mode` - Debug mode: `console`, `panel`
|
|
810
|
+
- `data-checkout-url` - Checkout page URL (for redirect behavior)
|
|
811
|
+
|
|
812
|
+
### Programmatic Initialization
|
|
813
|
+
|
|
814
|
+
```javascript
|
|
815
|
+
import { ElementsCheckout } from '@liquidcommerce/elements-sdk/checkout';
|
|
816
|
+
|
|
817
|
+
const client = await ElementsCheckout('YOUR_API_KEY', {
|
|
818
|
+
env: 'production'
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
const component = await client.injectCheckout({
|
|
822
|
+
containerId: 'checkout-container',
|
|
823
|
+
checkoutId: 'checkout-token-from-url', // Optional: checkout token
|
|
824
|
+
hideHeader: true // Optional
|
|
825
|
+
});
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
**Differences from full SDK:**
|
|
829
|
+
- Smaller bundle (tree-shaken, no product/cart/PLP components)
|
|
830
|
+
- Only `injectCheckout()` method available (no `injectProductElement`, `injectCartElement`, etc.)
|
|
831
|
+
- Checkout actions only (no `openCheckout`/`closeCheckout`/`toggleCheckout` drawer controls)
|
|
832
|
+
- Same theming, events, and configuration system
|
|
833
|
+
|
|
695
834
|
## TypeScript Types
|
|
696
835
|
|
|
697
836
|
### `ILiquidCommerceElementsConfig`
|
|
@@ -704,6 +843,11 @@ interface ILiquidCommerceElementsConfig {
|
|
|
704
843
|
customTheme?: IClientCustomThemeConfig;
|
|
705
844
|
proxy?: IElementsProxyConfig;
|
|
706
845
|
promoTicker?: IPromoTicker[];
|
|
846
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
interface ILiquidCommerceElementsCheckoutConfig {
|
|
850
|
+
pageUrl: string; // URL with {id} placeholder for checkout token
|
|
707
851
|
}
|
|
708
852
|
```
|
|
709
853
|
|
|
@@ -39,7 +39,12 @@ Complete guide to the LiquidCommerce Elements SDK documentation.
|
|
|
39
39
|
**Contents:**
|
|
40
40
|
- Basic configuration
|
|
41
41
|
- All configuration options with types
|
|
42
|
+
- Hosted checkout configuration
|
|
42
43
|
- Auto-initialization attributes
|
|
44
|
+
- Product list configuration (filters, search, grid)
|
|
45
|
+
- Mobile cart button attributes
|
|
46
|
+
- Custom cart elements (toggle, items count)
|
|
47
|
+
- Checkout-only build configuration
|
|
43
48
|
- URL parameter configuration
|
|
44
49
|
- TypeScript types
|
|
45
50
|
- Configuration examples
|
|
@@ -59,6 +64,7 @@ Complete guide to the LiquidCommerce Elements SDK documentation.
|
|
|
59
64
|
- Cart component theme
|
|
60
65
|
- Checkout component theme
|
|
61
66
|
- Address component theme
|
|
67
|
+
- Product list component theme (card styles, display modes)
|
|
62
68
|
- Dynamic theme updates (builder mode)
|
|
63
69
|
- Theme presets (example configurations)
|
|
64
70
|
- Best practices
|
|
@@ -72,7 +78,7 @@ Complete guide to the LiquidCommerce Elements SDK documentation.
|
|
|
72
78
|
- Product actions
|
|
73
79
|
- Address actions (Google Places & manual)
|
|
74
80
|
- Cart actions (including programmatic addProduct)
|
|
75
|
-
- Checkout actions (including programmatic addProduct)
|
|
81
|
+
- Checkout actions (including programmatic addProduct, exitCheckout)
|
|
76
82
|
- Action feedback events
|
|
77
83
|
- Event handling best practices
|
|
78
84
|
- Real-world business scenarios
|
|
@@ -238,6 +244,8 @@ docs/
|
|
|
238
244
|
### Features
|
|
239
245
|
- [Product Engraving](../README.md#product-engraving)
|
|
240
246
|
- [Product List](../README.md#product-list)
|
|
247
|
+
- [Product List Search & Filters](../README.md#product-list-search)
|
|
248
|
+
- [Hosted Checkout](../README.md#hosted-checkout-external-checkout-page)
|
|
241
249
|
- [Gift Options](../README.md#gift-options)
|
|
242
250
|
- [Promo Codes](../README.md#promo-codes)
|
|
243
251
|
- [Gift Cards](../README.md#gift-cards)
|
|
@@ -301,9 +309,9 @@ Want to contribute an example?
|
|
|
301
309
|
|
|
302
310
|
---
|
|
303
311
|
|
|
304
|
-
**Last updated:**
|
|
305
|
-
**SDK Version:** 2.x+
|
|
306
|
-
**Documentation Version:** 2.
|
|
312
|
+
**Last updated:** January 2026
|
|
313
|
+
**SDK Version:** 2.6.x+
|
|
314
|
+
**Documentation Version:** 2.1
|
|
307
315
|
|
|
308
316
|
|
|
309
317
|
---
|
package/docs/THEMING.md
CHANGED
|
@@ -180,6 +180,7 @@ interface IProductComponent {
|
|
|
180
180
|
};
|
|
181
181
|
layout: {
|
|
182
182
|
showImages: boolean;
|
|
183
|
+
showOnlyMainImage: boolean;
|
|
183
184
|
showTitle: boolean;
|
|
184
185
|
showDescription: boolean;
|
|
185
186
|
showQuantityCounter: boolean;
|
|
@@ -192,6 +193,8 @@ interface IProductComponent {
|
|
|
192
193
|
addToCartButtonShowTotalPrice: boolean;
|
|
193
194
|
buyNowButtonText: string;
|
|
194
195
|
preSaleButtonText: string;
|
|
196
|
+
prioritizeEngraving: boolean;
|
|
197
|
+
noAvailabilityText: string;
|
|
195
198
|
};
|
|
196
199
|
}
|
|
197
200
|
```
|
|
@@ -205,6 +208,7 @@ customTheme: {
|
|
|
205
208
|
},
|
|
206
209
|
layout: {
|
|
207
210
|
showImages: true,
|
|
211
|
+
showOnlyMainImage: false,
|
|
208
212
|
showTitle: true,
|
|
209
213
|
showDescription: true,
|
|
210
214
|
showQuantityCounter: true,
|
|
@@ -216,7 +220,9 @@ customTheme: {
|
|
|
216
220
|
addToCartButtonText: 'Add to Cart',
|
|
217
221
|
addToCartButtonShowTotalPrice: true,
|
|
218
222
|
buyNowButtonText: 'Buy Now',
|
|
219
|
-
preSaleButtonText: 'Pre-Order'
|
|
223
|
+
preSaleButtonText: 'Pre-Order',
|
|
224
|
+
prioritizeEngraving: false,
|
|
225
|
+
noAvailabilityText: 'Not available in your area'
|
|
220
226
|
}
|
|
221
227
|
}
|
|
222
228
|
}
|
|
@@ -261,10 +267,6 @@ customTheme: {
|
|
|
261
267
|
interface ICheckoutComponent {
|
|
262
268
|
theme: {
|
|
263
269
|
backgroundColor: string;
|
|
264
|
-
checkoutCompleted: {
|
|
265
|
-
customLogo: string;
|
|
266
|
-
customText: string | null;
|
|
267
|
-
};
|
|
268
270
|
};
|
|
269
271
|
layout: {
|
|
270
272
|
emailOptIn: {
|
|
@@ -282,10 +284,15 @@ interface ICheckoutComponent {
|
|
|
282
284
|
show: boolean;
|
|
283
285
|
text: string;
|
|
284
286
|
};
|
|
287
|
+
continueShoppingUrl: string;
|
|
285
288
|
exitUrl: string;
|
|
286
289
|
thankYouButtonText: string;
|
|
287
290
|
drawerHeaderText: string;
|
|
288
291
|
placeOrderButtonText: string;
|
|
292
|
+
checkoutCompleted: {
|
|
293
|
+
customLogo: string;
|
|
294
|
+
customText: string | null;
|
|
295
|
+
};
|
|
289
296
|
};
|
|
290
297
|
}
|
|
291
298
|
```
|
|
@@ -295,11 +302,7 @@ interface ICheckoutComponent {
|
|
|
295
302
|
customTheme: {
|
|
296
303
|
checkout: {
|
|
297
304
|
theme: {
|
|
298
|
-
backgroundColor: '#ffffff'
|
|
299
|
-
checkoutCompleted: {
|
|
300
|
-
customLogo: 'https://yourdomain.com/logo.png',
|
|
301
|
-
customText: 'Thank you for your order!'
|
|
302
|
-
}
|
|
305
|
+
backgroundColor: '#ffffff'
|
|
303
306
|
},
|
|
304
307
|
layout: {
|
|
305
308
|
emailOptIn: {
|
|
@@ -317,15 +320,26 @@ customTheme: {
|
|
|
317
320
|
show: true,
|
|
318
321
|
text: 'By placing this order, you agree to our terms and conditions.'
|
|
319
322
|
},
|
|
323
|
+
continueShoppingUrl: '/',
|
|
320
324
|
exitUrl: '/',
|
|
321
325
|
thankYouButtonText: 'Continue Shopping',
|
|
322
326
|
drawerHeaderText: 'Checkout',
|
|
323
|
-
placeOrderButtonText: 'Place Order'
|
|
327
|
+
placeOrderButtonText: 'Place Order',
|
|
328
|
+
checkoutCompleted: {
|
|
329
|
+
customLogo: 'https://yourdomain.com/logo.png',
|
|
330
|
+
customText: 'Thank you for your order!'
|
|
331
|
+
}
|
|
324
332
|
}
|
|
325
333
|
}
|
|
326
334
|
}
|
|
327
335
|
```
|
|
328
336
|
|
|
337
|
+
**Layout Properties:**
|
|
338
|
+
|
|
339
|
+
- **`continueShoppingUrl`** (string): URL to redirect to when customer clicks "Continue Shopping" after order completion
|
|
340
|
+
- **`exitUrl`** (string): URL for the exit/close action in checkout
|
|
341
|
+
- **`legalMessage.text`** (string): Supports rich text / HTML content
|
|
342
|
+
|
|
329
343
|
## Address Component
|
|
330
344
|
|
|
331
345
|
```typescript
|
|
@@ -347,6 +361,77 @@ customTheme: {
|
|
|
347
361
|
}
|
|
348
362
|
```
|
|
349
363
|
|
|
364
|
+
## Product List Component
|
|
365
|
+
|
|
366
|
+
```typescript
|
|
367
|
+
interface IProductListComponent {
|
|
368
|
+
theme: {
|
|
369
|
+
backgroundColor: string;
|
|
370
|
+
};
|
|
371
|
+
layout: {
|
|
372
|
+
productCard: {
|
|
373
|
+
style: 'card' | 'ghost';
|
|
374
|
+
cornerRadius: 'rounded' | 'sharp';
|
|
375
|
+
showPrice: boolean;
|
|
376
|
+
showSizeSelector: boolean;
|
|
377
|
+
showFulfillment: boolean;
|
|
378
|
+
showRetailerName: boolean;
|
|
379
|
+
showQuantityCounter: boolean;
|
|
380
|
+
enableShippingFulfillment: boolean;
|
|
381
|
+
enableOnDemandFulfillment: boolean;
|
|
382
|
+
showCollections: boolean;
|
|
383
|
+
enablePersonalization: boolean;
|
|
384
|
+
};
|
|
385
|
+
displayMode: 'modal' | 'drawer';
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Example:**
|
|
391
|
+
```javascript
|
|
392
|
+
customTheme: {
|
|
393
|
+
productList: {
|
|
394
|
+
theme: {
|
|
395
|
+
backgroundColor: '#f8f9fa'
|
|
396
|
+
},
|
|
397
|
+
layout: {
|
|
398
|
+
productCard: {
|
|
399
|
+
style: 'card',
|
|
400
|
+
cornerRadius: 'rounded',
|
|
401
|
+
showPrice: true,
|
|
402
|
+
showSizeSelector: true,
|
|
403
|
+
showFulfillment: true,
|
|
404
|
+
showRetailerName: false,
|
|
405
|
+
showQuantityCounter: true,
|
|
406
|
+
enableShippingFulfillment: true,
|
|
407
|
+
enableOnDemandFulfillment: true,
|
|
408
|
+
showCollections: false,
|
|
409
|
+
enablePersonalization: true
|
|
410
|
+
},
|
|
411
|
+
displayMode: 'drawer'
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Card Style Options:**
|
|
418
|
+
|
|
419
|
+
- **`style`**: `'card'` shows a bordered card with background, `'ghost'` shows a minimal borderless card
|
|
420
|
+
- **`cornerRadius`**: `'rounded'` uses rounded corners, `'sharp'` uses square corners
|
|
421
|
+
- **`displayMode`**: `'modal'` opens product details in a modal, `'drawer'` opens in a side drawer
|
|
422
|
+
|
|
423
|
+
**Card Feature Flags:**
|
|
424
|
+
|
|
425
|
+
- **`showPrice`**: Display price on the product card
|
|
426
|
+
- **`showSizeSelector`**: Show size/variant selector on the card
|
|
427
|
+
- **`showFulfillment`**: Show fulfillment type indicator
|
|
428
|
+
- **`showRetailerName`**: Show the retailer name
|
|
429
|
+
- **`showQuantityCounter`**: Show quantity increment/decrement controls
|
|
430
|
+
- **`enableShippingFulfillment`**: Allow shipping fulfillment option
|
|
431
|
+
- **`enableOnDemandFulfillment`**: Allow on-demand fulfillment option
|
|
432
|
+
- **`showCollections`**: Show product collection/tag labels
|
|
433
|
+
- **`enablePersonalization`**: Show personalization/engraving option on cards
|
|
434
|
+
|
|
350
435
|
## Complete Configuration Example
|
|
351
436
|
|
|
352
437
|
```javascript
|
|
@@ -390,6 +475,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
390
475
|
},
|
|
391
476
|
layout: {
|
|
392
477
|
showImages: true,
|
|
478
|
+
showOnlyMainImage: false,
|
|
393
479
|
showTitle: true,
|
|
394
480
|
showDescription: true,
|
|
395
481
|
showQuantityCounter: true,
|
|
@@ -401,7 +487,9 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
401
487
|
addToCartButtonText: 'Add to Cart',
|
|
402
488
|
addToCartButtonShowTotalPrice: true,
|
|
403
489
|
buyNowButtonText: 'Buy Now',
|
|
404
|
-
preSaleButtonText: 'Pre-Order'
|
|
490
|
+
preSaleButtonText: 'Pre-Order',
|
|
491
|
+
prioritizeEngraving: false,
|
|
492
|
+
noAvailabilityText: 'Not available in your area'
|
|
405
493
|
}
|
|
406
494
|
},
|
|
407
495
|
cart: {
|
|
@@ -417,11 +505,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
417
505
|
},
|
|
418
506
|
checkout: {
|
|
419
507
|
theme: {
|
|
420
|
-
backgroundColor: '#ffffff'
|
|
421
|
-
checkoutCompleted: {
|
|
422
|
-
customLogo: 'https://yourdomain.com/logo.png',
|
|
423
|
-
customText: null
|
|
424
|
-
}
|
|
508
|
+
backgroundColor: '#ffffff'
|
|
425
509
|
},
|
|
426
510
|
layout: {
|
|
427
511
|
emailOptIn: {
|
|
@@ -439,10 +523,15 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
439
523
|
show: false,
|
|
440
524
|
text: ''
|
|
441
525
|
},
|
|
526
|
+
continueShoppingUrl: '/',
|
|
442
527
|
exitUrl: '/',
|
|
443
528
|
thankYouButtonText: 'Continue Shopping',
|
|
444
529
|
drawerHeaderText: 'Checkout',
|
|
445
|
-
placeOrderButtonText: 'Place Order'
|
|
530
|
+
placeOrderButtonText: 'Place Order',
|
|
531
|
+
checkoutCompleted: {
|
|
532
|
+
customLogo: 'https://yourdomain.com/logo.png',
|
|
533
|
+
customText: null
|
|
534
|
+
}
|
|
446
535
|
}
|
|
447
536
|
},
|
|
448
537
|
address: {
|
package/package.json
CHANGED