@liquidcommerce/elements-sdk 2.6.0-beta.6 → 2.6.0-beta.60
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 +83 -2519
- package/dist/index.checkout.esm.js +16576 -0
- package/dist/index.esm.js +23616 -21095
- package/dist/ssr-stub.checkout.esm.js +18 -0
- package/dist/ssr-stub.esm.js +270 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +46 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +2 -6
- package/dist/types/core/api/api-client.service.d.ts +21 -20
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +40 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -1
- package/dist/types/core/base-component.service.d.ts +2 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +56 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -70
- package/dist/types/core/client/client-config.service.d.ts +8 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +4 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +45 -50
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +9 -4
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -75
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -56
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +17 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +14 -3
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +39 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
- package/dist/types/interfaces/api/checkout.interface.d.ts +238 -0
- package/dist/types/interfaces/api/index.d.ts +5 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +39 -0
- package/dist/types/interfaces/api/product.interface.d.ts +9 -4
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +41 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +5 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +47 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +2 -1
- package/dist/types/interfaces/injection.interface.d.ts +47 -0
- package/dist/types/modules/address/address.command.d.ts +2 -1
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -5
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +23 -9
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +3 -0
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +3 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +5 -2
- package/dist/types/modules/product/product.commands.d.ts +2 -3
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -2
- 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-card.component.d.ts +27 -30
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +55 -36
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +46 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-search.component.d.ts → product-list-search.component.d.ts} +11 -4
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +8 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +23 -8
- package/dist/types/modules/product-list/product-list.component.d.ts +11 -45
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +20 -35
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +1 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +6 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +5 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +5 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +0 -14
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +10 -0
- package/docs/v1/README.md +210 -0
- package/docs/v1/api/actions/address-actions.md +281 -0
- package/docs/v1/api/actions/cart-actions.md +337 -0
- package/docs/v1/api/actions/checkout-actions.md +387 -0
- package/docs/v1/api/actions/product-actions.md +115 -0
- package/docs/v1/api/client.md +482 -0
- package/docs/v1/api/configuration.md +1 -0
- package/docs/v1/api/injection-methods.md +247 -0
- package/docs/v1/api/typescript-types.md +1 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +96 -0
- package/docs/v1/examples/checkout-flow.md +91 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +507 -0
- package/docs/v1/getting-started/installation.md +328 -0
- package/docs/v1/getting-started/quick-start.md +405 -0
- package/docs/v1/guides/address-component.md +431 -0
- package/docs/v1/guides/best-practices.md +324 -0
- package/docs/v1/guides/cart-component.md +737 -0
- package/docs/v1/guides/checkout-component.md +672 -0
- package/docs/v1/guides/events.md +926 -0
- package/docs/v1/guides/product-component.md +686 -0
- package/docs/v1/guides/product-list-component.md +598 -0
- package/docs/v1/guides/theming.md +216 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +89 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/browser-support.md +44 -0
- package/docs/v1/reference/error-handling.md +70 -0
- package/docs/v1/reference/performance.md +54 -0
- package/docs/v1/reference/troubleshooting.md +72 -0
- package/package.json +28 -17
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -106
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -42
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -211
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -5
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
- package/dist/types/utils/helper.d.ts +0 -27
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
# Cart Actions API
|
|
2
|
+
|
|
3
|
+
Cart actions allow you to programmatically control the shopping cart.
|
|
4
|
+
|
|
5
|
+
## actions.cart.openCart()
|
|
6
|
+
|
|
7
|
+
Open the cart drawer.
|
|
8
|
+
|
|
9
|
+
### Signature
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
openCart(): void
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
window.LiquidCommerce.elements.actions.cart.openCart();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## actions.cart.closeCart()
|
|
24
|
+
|
|
25
|
+
Close the cart drawer.
|
|
26
|
+
|
|
27
|
+
### Signature
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
closeCart(): void
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Example
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
window.LiquidCommerce.elements.actions.cart.closeCart();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## actions.cart.toggleCart()
|
|
42
|
+
|
|
43
|
+
Toggle the cart drawer open/closed.
|
|
44
|
+
|
|
45
|
+
### Signature
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
toggleCart(): void
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Example
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
// Add to your cart button
|
|
55
|
+
document.getElementById('cart-btn').addEventListener('click', () => {
|
|
56
|
+
window.LiquidCommerce.elements.actions.cart.toggleCart();
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## actions.cart.addProduct()
|
|
63
|
+
|
|
64
|
+
Add products to the cart programmatically.
|
|
65
|
+
|
|
66
|
+
### Signature
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
addProduct(params: IAddProductParams[], openCart?: boolean): Promise<void>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Parameters
|
|
73
|
+
|
|
74
|
+
| Parameter | Type | Required | Description |
|
|
75
|
+
|-----------|------|----------|-------------|
|
|
76
|
+
| `params` | IAddProductParams[] | Yes | Array of products to add |
|
|
77
|
+
| `openCart` | boolean | No | Open cart after adding (default: false) |
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
interface IAddProductParams {
|
|
81
|
+
identifier: string; // Product UPC, SKU, or ID
|
|
82
|
+
fulfillmentType: FulfillmentType; // 'shipping' or 'onDemand'
|
|
83
|
+
quantity: number; // Number of items
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Example
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
// Add single product
|
|
91
|
+
await window.LiquidCommerce.elements.actions.cart.addProduct([
|
|
92
|
+
{
|
|
93
|
+
identifier: '00619947000020',
|
|
94
|
+
fulfillmentType: 'shipping',
|
|
95
|
+
quantity: 1
|
|
96
|
+
}
|
|
97
|
+
], true); // Open cart after adding
|
|
98
|
+
|
|
99
|
+
// Add multiple products
|
|
100
|
+
await window.LiquidCommerce.elements.actions.cart.addProduct([
|
|
101
|
+
{
|
|
102
|
+
identifier: '00619947000020',
|
|
103
|
+
fulfillmentType: 'shipping',
|
|
104
|
+
quantity: 2
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
identifier: '08504405135',
|
|
108
|
+
fulfillmentType: 'onDemand',
|
|
109
|
+
quantity: 1
|
|
110
|
+
}
|
|
111
|
+
]);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Address Requirement
|
|
115
|
+
|
|
116
|
+
If no address is set, the SDK automatically:
|
|
117
|
+
1. Opens address input drawer
|
|
118
|
+
2. Waits for user to set address
|
|
119
|
+
3. Retries add-to-cart operation
|
|
120
|
+
|
|
121
|
+
### Errors
|
|
122
|
+
|
|
123
|
+
**Throws `SDKError` if:**
|
|
124
|
+
- Identifier is invalid
|
|
125
|
+
- Fulfillment type is not `'shipping'` or `'onDemand'`
|
|
126
|
+
- Quantity is less than 1
|
|
127
|
+
- Product is not available
|
|
128
|
+
- Product is a presale item
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## actions.cart.applyPromoCode()
|
|
133
|
+
|
|
134
|
+
Apply a promo code to the cart.
|
|
135
|
+
|
|
136
|
+
### Signature
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
applyPromoCode(promoCode: string): Promise<void>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Parameters
|
|
143
|
+
|
|
144
|
+
| Parameter | Type | Required | Description |
|
|
145
|
+
|-----------|------|----------|-------------|
|
|
146
|
+
| `promoCode` | string | Yes | Promo code to apply |
|
|
147
|
+
|
|
148
|
+
### Example
|
|
149
|
+
|
|
150
|
+
```javascript
|
|
151
|
+
try {
|
|
152
|
+
await window.LiquidCommerce.elements.actions.cart.applyPromoCode('SUMMER20');
|
|
153
|
+
console.log('Promo code applied successfully');
|
|
154
|
+
} catch (error) {
|
|
155
|
+
console.error('Invalid promo code:', error);
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Notes
|
|
160
|
+
|
|
161
|
+
- Code is automatically normalized (trimmed, uppercased)
|
|
162
|
+
- Promo codes must be enabled in configuration
|
|
163
|
+
- Only one promo code can be active at a time
|
|
164
|
+
- Applying a new code replaces the existing one
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## actions.cart.removePromoCode()
|
|
169
|
+
|
|
170
|
+
Remove the active promo code.
|
|
171
|
+
|
|
172
|
+
### Signature
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
removePromoCode(): Promise<void>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Example
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
await window.LiquidCommerce.elements.actions.cart.removePromoCode();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## actions.cart.resetCart()
|
|
187
|
+
|
|
188
|
+
Clear all items from the cart.
|
|
189
|
+
|
|
190
|
+
### Signature
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
resetCart(): Promise<void>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Example
|
|
197
|
+
|
|
198
|
+
```javascript
|
|
199
|
+
await window.LiquidCommerce.elements.actions.cart.resetCart();
|
|
200
|
+
console.log('Cart cleared');
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Warning
|
|
204
|
+
|
|
205
|
+
This permanently removes all cart items. There is no undo.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## actions.cart.getDetails()
|
|
210
|
+
|
|
211
|
+
Retrieve current cart information.
|
|
212
|
+
|
|
213
|
+
### Signature
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
getDetails(): IBaseCartEventData
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Returns
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
interface IBaseCartEventData {
|
|
223
|
+
cartId: string;
|
|
224
|
+
items: ICartItem[];
|
|
225
|
+
subtotal: number; // in cents
|
|
226
|
+
total: number; // in cents
|
|
227
|
+
itemsCount: number;
|
|
228
|
+
itemsQuantity: number;
|
|
229
|
+
promoCode?: {
|
|
230
|
+
code: string;
|
|
231
|
+
discount: number; // in cents
|
|
232
|
+
};
|
|
233
|
+
retailers: IRetailer[];
|
|
234
|
+
// ... additional fields
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Example
|
|
239
|
+
|
|
240
|
+
```javascript
|
|
241
|
+
const cart = window.LiquidCommerce.elements.actions.cart.getDetails();
|
|
242
|
+
|
|
243
|
+
console.log(`Cart ID: ${cart.cartId}`);
|
|
244
|
+
console.log(`Items: ${cart.itemsCount}`);
|
|
245
|
+
console.log(`Subtotal: $${cart.subtotal / 100}`);
|
|
246
|
+
console.log(`Total: $${cart.total / 100}`);
|
|
247
|
+
|
|
248
|
+
if (cart.promoCode) {
|
|
249
|
+
console.log(`Discount: $${cart.promoCode.discount / 100}`);
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Use Cases
|
|
254
|
+
|
|
255
|
+
#### Display Cart Summary
|
|
256
|
+
|
|
257
|
+
```javascript
|
|
258
|
+
function updateCartSummary() {
|
|
259
|
+
const cart = window.LiquidCommerce.elements.actions.cart.getDetails();
|
|
260
|
+
|
|
261
|
+
document.getElementById('cart-count').textContent = cart.itemsCount;
|
|
262
|
+
document.getElementById('cart-total').textContent = `$${cart.total / 100}`;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Update on cart changes
|
|
266
|
+
window.addEventListener('lce:actions.cart_updated', updateCartSummary);
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### Check Cart Before Checkout
|
|
270
|
+
|
|
271
|
+
```javascript
|
|
272
|
+
document.getElementById('checkout-btn').addEventListener('click', () => {
|
|
273
|
+
const cart = window.LiquidCommerce.elements.actions.cart.getDetails();
|
|
274
|
+
|
|
275
|
+
if (cart.itemsCount === 0) {
|
|
276
|
+
alert('Your cart is empty');
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
window.LiquidCommerce.elements.actions.checkout.openCheckout();
|
|
281
|
+
});
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### Track Cart Value
|
|
285
|
+
|
|
286
|
+
```javascript
|
|
287
|
+
const cart = window.LiquidCommerce.elements.actions.cart.getDetails();
|
|
288
|
+
|
|
289
|
+
gtag('event', 'view_cart', {
|
|
290
|
+
value: cart.total / 100,
|
|
291
|
+
currency: 'USD',
|
|
292
|
+
items: cart.items.map(item => ({
|
|
293
|
+
item_id: item.identifier,
|
|
294
|
+
quantity: item.quantity
|
|
295
|
+
}))
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Events
|
|
300
|
+
|
|
301
|
+
Cart actions trigger events that you can listen for:
|
|
302
|
+
|
|
303
|
+
```javascript
|
|
304
|
+
// Item added
|
|
305
|
+
window.addEventListener('lce:actions.cart_item_added', (event) => {
|
|
306
|
+
console.log('Item added:', event.detail.data);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// Cart updated
|
|
310
|
+
window.addEventListener('lce:actions.cart_updated', (event) => {
|
|
311
|
+
console.log('Cart updated:', event.detail.data);
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// Promo code applied
|
|
315
|
+
window.addEventListener('lce:actions.cart_promo_code_applied', (event) => {
|
|
316
|
+
console.log('Promo applied:', event.detail.data);
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// Product add success
|
|
320
|
+
window.addEventListener('lce:actions.cart_product_add_success', (event) => {
|
|
321
|
+
console.log('Products added:', event.detail.data);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// Product add failed
|
|
325
|
+
window.addEventListener('lce:actions.cart_product_add_failed', (event) => {
|
|
326
|
+
console.error('Failed to add:', event.detail.data);
|
|
327
|
+
});
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
See [Events Guide](../../guides/events.md) for all cart events.
|
|
331
|
+
|
|
332
|
+
## See Also
|
|
333
|
+
|
|
334
|
+
- [Cart Component Guide](../../guides/cart-component.md)
|
|
335
|
+
- [Cart Events](../../guides/events.md#cart-events)
|
|
336
|
+
- [Product Actions](./product-actions.md)
|
|
337
|
+
- [Checkout Actions](./checkout-actions.md)
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# Checkout Actions API
|
|
2
|
+
|
|
3
|
+
Checkout actions allow you to programmatically control the checkout flow.
|
|
4
|
+
|
|
5
|
+
## Navigation Actions
|
|
6
|
+
|
|
7
|
+
### actions.checkout.openCheckout()
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
openCheckout(): void
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Opens the checkout drawer or navigates to checkout page.
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
window.LiquidCommerce.elements.actions.checkout.openCheckout();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### actions.checkout.closeCheckout()
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
closeCheckout(): void
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Closes the checkout drawer.
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
window.LiquidCommerce.elements.actions.checkout.closeCheckout();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### actions.checkout.toggleCheckout()
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
toggleCheckout(): void
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Toggles checkout open/closed.
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
window.LiquidCommerce.elements.actions.checkout.toggleCheckout();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### actions.checkout.exitCheckout()
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
exitCheckout(): void
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Navigates away from checkout (requires `exitUrl` configuration).
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
window.LiquidCommerce.elements.actions.checkout.exitCheckout();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Product Actions
|
|
56
|
+
|
|
57
|
+
### actions.checkout.addProduct()
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
addProduct(params: IAddProductParams[], openCheckout?: boolean): Promise<void>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Add products directly to checkout, bypassing the cart.
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
await window.LiquidCommerce.elements.actions.checkout.addProduct([
|
|
67
|
+
{
|
|
68
|
+
identifier: '00619947000020',
|
|
69
|
+
fulfillmentType: 'shipping',
|
|
70
|
+
quantity: 1
|
|
71
|
+
}
|
|
72
|
+
], true); // Open checkout after adding
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Promo & Gift Card Actions
|
|
76
|
+
|
|
77
|
+
### actions.checkout.applyPromoCode()
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
applyPromoCode(promoCode: string): Promise<void>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Apply a promo code during checkout.
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
await window.LiquidCommerce.elements.actions.checkout.applyPromoCode('WELCOME10');
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### actions.checkout.removePromoCode()
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
removePromoCode(): Promise<void>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Remove the active promo code.
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
await window.LiquidCommerce.elements.actions.checkout.removePromoCode();
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### actions.checkout.applyGiftCard()
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
applyGiftCard(code: string): Promise<void>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Apply a gift card.
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
await window.LiquidCommerce.elements.actions.checkout.applyGiftCard('GIFT-1234-5678-9012');
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### actions.checkout.removeGiftCard()
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
removeGiftCard(code: string): Promise<void>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Remove a gift card.
|
|
120
|
+
|
|
121
|
+
```javascript
|
|
122
|
+
await window.LiquidCommerce.elements.actions.checkout.removeGiftCard('GIFT-1234-5678-9012');
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Toggle Actions
|
|
126
|
+
|
|
127
|
+
### actions.checkout.toggleIsGift()
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
toggleIsGift(active?: boolean): Promise<void>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Enable/disable gift mode.
|
|
134
|
+
|
|
135
|
+
```javascript
|
|
136
|
+
// Enable
|
|
137
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(true);
|
|
138
|
+
|
|
139
|
+
// Disable
|
|
140
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(false);
|
|
141
|
+
|
|
142
|
+
// Toggle
|
|
143
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift();
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### actions.checkout.toggleBillingSameAsShipping()
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
toggleBillingSameAsShipping(active?: boolean): Promise<void>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Set whether billing address matches shipping.
|
|
153
|
+
|
|
154
|
+
```javascript
|
|
155
|
+
// Use shipping address for billing
|
|
156
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(true);
|
|
157
|
+
|
|
158
|
+
// Use different billing address
|
|
159
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleBillingSameAsShipping(false);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### actions.checkout.toggleMarketingPreferences()
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
toggleMarketingPreferences(field: 'canEmail' | 'canSms', active: boolean): Promise<void>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Set marketing opt-in preferences.
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
// Opt into email marketing
|
|
172
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canEmail', true);
|
|
173
|
+
|
|
174
|
+
// Opt into SMS marketing
|
|
175
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleMarketingPreferences('canSms', true);
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Form Update Actions
|
|
179
|
+
|
|
180
|
+
### actions.checkout.updateCustomerInfo()
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
updateCustomerInfo(params: Record<CustomerFieldName, string>): void
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Pre-fill customer information.
|
|
187
|
+
|
|
188
|
+
**Available fields:**
|
|
189
|
+
- `firstName`, `lastName`
|
|
190
|
+
- `email`, `phone`
|
|
191
|
+
- `birthdate`, `addressTwo`
|
|
192
|
+
- `company`
|
|
193
|
+
|
|
194
|
+
```javascript
|
|
195
|
+
window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
|
|
196
|
+
firstName: 'John',
|
|
197
|
+
lastName: 'Doe',
|
|
198
|
+
email: 'john@example.com',
|
|
199
|
+
phone: '+15551234567',
|
|
200
|
+
birthdate: '1990-01-01',
|
|
201
|
+
addressTwo: 'Apt 4B',
|
|
202
|
+
company: 'Acme Corp'
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### actions.checkout.updateBillingInfo()
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
updateBillingInfo(params: Record<BillingFieldName, string>): void
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Pre-fill billing address.
|
|
213
|
+
|
|
214
|
+
**Available fields:**
|
|
215
|
+
- `firstName`, `lastName`
|
|
216
|
+
- `email`, `phone`, `company`
|
|
217
|
+
- `addressOne`, `addressTwo`
|
|
218
|
+
- `city`, `state`, `zipCode`
|
|
219
|
+
|
|
220
|
+
```javascript
|
|
221
|
+
window.LiquidCommerce.elements.actions.checkout.updateBillingInfo({
|
|
222
|
+
firstName: 'John',
|
|
223
|
+
lastName: 'Doe',
|
|
224
|
+
email: 'john@example.com',
|
|
225
|
+
phone: '+15551234567',
|
|
226
|
+
company: 'Acme Corp',
|
|
227
|
+
addressOne: '123 Main St',
|
|
228
|
+
addressTwo: 'Apt 4B',
|
|
229
|
+
city: 'New York',
|
|
230
|
+
state: 'NY',
|
|
231
|
+
zipCode: '10001'
|
|
232
|
+
});
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### actions.checkout.updateGiftInfo()
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
updateGiftInfo(params: Record<GiftFieldName, string>): void
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Pre-fill gift recipient information.
|
|
242
|
+
|
|
243
|
+
**Available fields:**
|
|
244
|
+
- `firstName`, `lastName`
|
|
245
|
+
- `email`, `phone`
|
|
246
|
+
- `message`, `addressTwo`
|
|
247
|
+
|
|
248
|
+
```javascript
|
|
249
|
+
window.LiquidCommerce.elements.actions.checkout.updateGiftInfo({
|
|
250
|
+
firstName: 'Jane',
|
|
251
|
+
lastName: 'Smith',
|
|
252
|
+
email: 'jane@example.com',
|
|
253
|
+
phone: '+15559876543',
|
|
254
|
+
addressTwo: 'Suite 200',
|
|
255
|
+
message: 'Happy Birthday!',
|
|
256
|
+
});
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Data Retrieval
|
|
260
|
+
|
|
261
|
+
### actions.checkout.getDetails()
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
getDetails(): ICheckoutDetailsEventData
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Retrieve current checkout information.
|
|
268
|
+
|
|
269
|
+
```javascript
|
|
270
|
+
const checkout = window.LiquidCommerce.elements.actions.checkout.getDetails();
|
|
271
|
+
|
|
272
|
+
console.log(`Cart ID: ${checkout.cartId}`);
|
|
273
|
+
console.log(`Total: $${checkout.amounts.total / 100}`);
|
|
274
|
+
console.log(`Items: ${checkout.items.length}`);
|
|
275
|
+
console.log(`Is Gift: ${checkout.isGift}`);
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Returns:**
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
interface ICheckoutDetailsEventData {
|
|
282
|
+
cartId: string;
|
|
283
|
+
items: ICheckoutItem[];
|
|
284
|
+
amounts: {
|
|
285
|
+
subtotal: number;
|
|
286
|
+
tax: number;
|
|
287
|
+
shipping: number;
|
|
288
|
+
tip: number;
|
|
289
|
+
total: number;
|
|
290
|
+
};
|
|
291
|
+
customer: ICustomerInfo;
|
|
292
|
+
shippingAddress: IAddress;
|
|
293
|
+
billingAddress?: IAddress;
|
|
294
|
+
isGift: boolean;
|
|
295
|
+
giftRecipient?: IGiftRecipient;
|
|
296
|
+
promoCode?: IPromoCode;
|
|
297
|
+
giftCards: IGiftCard[];
|
|
298
|
+
// ... additional fields
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Use Cases
|
|
303
|
+
|
|
304
|
+
### Pre-fill for Logged-In Users
|
|
305
|
+
|
|
306
|
+
```javascript
|
|
307
|
+
window.addEventListener('lce:actions.checkout_opened', () => {
|
|
308
|
+
if (userIsLoggedIn) {
|
|
309
|
+
window.LiquidCommerce.elements.actions.checkout.updateCustomerInfo({
|
|
310
|
+
firstName: currentUser.firstName,
|
|
311
|
+
lastName: currentUser.lastName,
|
|
312
|
+
email: currentUser.email,
|
|
313
|
+
phone: currentUser.phone
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Track Checkout Progress
|
|
320
|
+
|
|
321
|
+
```javascript
|
|
322
|
+
window.addEventListener('lce:actions.checkout_customer_information_updated', () => {
|
|
323
|
+
gtag('event', 'checkout_progress', { step: 'customer_info' });
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
window.addEventListener('lce:actions.checkout_submit_started', () => {
|
|
327
|
+
gtag('event', 'checkout_progress', { step: 'payment' });
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
window.addEventListener('lce:actions.checkout_submit_completed', (event) => {
|
|
331
|
+
const { orderId, total } = event.detail.data;
|
|
332
|
+
|
|
333
|
+
gtag('event', 'purchase', {
|
|
334
|
+
transaction_id: orderId,
|
|
335
|
+
value: total / 100,
|
|
336
|
+
currency: 'USD'
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Gift Flow
|
|
342
|
+
|
|
343
|
+
```javascript
|
|
344
|
+
document.getElementById('gift-checkbox').addEventListener('change', async (e) => {
|
|
345
|
+
await window.LiquidCommerce.elements.actions.checkout.toggleIsGift(e.target.checked);
|
|
346
|
+
|
|
347
|
+
if (e.target.checked) {
|
|
348
|
+
showGiftForm();
|
|
349
|
+
} else {
|
|
350
|
+
hideGiftForm();
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Auto-Apply Campaign Codes
|
|
356
|
+
|
|
357
|
+
```javascript
|
|
358
|
+
const params = new URLSearchParams(window.location.search);
|
|
359
|
+
const campaignCode = params.get('promo');
|
|
360
|
+
|
|
361
|
+
if (campaignCode) {
|
|
362
|
+
window.addEventListener('lce:actions.checkout_opened', async () => {
|
|
363
|
+
try {
|
|
364
|
+
await window.LiquidCommerce.elements.actions.checkout.applyPromoCode(campaignCode);
|
|
365
|
+
} catch (error) {
|
|
366
|
+
console.log('Invalid campaign code');
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Events
|
|
373
|
+
|
|
374
|
+
Checkout actions trigger numerous events. See [Checkout Events](../../guides/events.md#checkout-events) for complete list.
|
|
375
|
+
|
|
376
|
+
Key events:
|
|
377
|
+
- `checkout_opened`, `checkout_closed`
|
|
378
|
+
- `checkout_customer_information_updated`
|
|
379
|
+
- `checkout_submit_started`, `checkout_submit_completed`, `checkout_submit_failed`
|
|
380
|
+
- `checkout_promo_code_applied`, `checkout_promo_code_failed`
|
|
381
|
+
- `checkout_gift_card_applied`, `checkout_gift_card_failed`
|
|
382
|
+
|
|
383
|
+
## See Also
|
|
384
|
+
|
|
385
|
+
- [Checkout Component Guide](../../guides/checkout-component.md)
|
|
386
|
+
- [Checkout Events](../../guides/events.md#checkout-events)
|
|
387
|
+
- [Cart Actions](./cart-actions.md)
|