@liquidcommerce/elements-sdk 2.4.4 → 2.4.5

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.
@@ -37,6 +37,7 @@ export declare class StoreService {
37
37
  private debouncedSave;
38
38
  forceSave(): void;
39
39
  persist(): Promise<void>;
40
+ clearLocalStorage(): void;
40
41
  private saveStore;
41
42
  private loadPersistedState;
42
43
  private loadFromDBPersistence;
@@ -14,6 +14,8 @@ export interface IProductLayout {
14
14
  addToCartButtonShowTotalPrice: boolean;
15
15
  buyNowButtonText: string;
16
16
  preSaleButtonText: string;
17
+ prioritizeEngraving: boolean;
18
+ noAvailabilityText: string;
17
19
  }
18
20
  export interface IProductTheme {
19
21
  backgroundColor: string;
@@ -12,6 +12,7 @@ export declare class ApiClientService {
12
12
  getAllConfigs(): Promise<IAllConfigs>;
13
13
  setPersistedStore(userDeviceId: string, data: IPersistedStore): Promise<void>;
14
14
  getPersistedStore(userDeviceId: string): Promise<IPersistedStore | null>;
15
+ deletePersistedStore(userDeviceId: string): Promise<void>;
15
16
  getProductsData(identifier: string[], location?: ILoc): Promise<IProductData | null>;
16
17
  getCartData(id: string | null): Promise<ICart>;
17
18
  updateCart(params: ICartUpdateParams & {
package/docs/ACTIONS.md CHANGED
@@ -212,6 +212,33 @@ if (address) {
212
212
  actions.address.clear();
213
213
  ```
214
214
 
215
+ **Complete Reset Behavior:**
216
+ The `actions.address.clear()` action performs a comprehensive reset of the user's address and shopping session:
217
+
218
+ **What gets cleared:**
219
+ - ✅ **Address Data**: All saved address information (street, city, state, zip, coordinates, Places ID)
220
+ - ✅ **Cart Contents**: Complete cart reset (removes all items, totals, promo codes, retailers)
221
+ - ✅ **Local Storage**: Completely removes the localStorage entry and its value
222
+ - ✅ **Database**: Deletes the persisted store from the server database
223
+ - ✅ **Checkout State**: Resets any pending checkout information
224
+
225
+ **Why the cart is reset:**
226
+ When an address is cleared, the cart must be reset because:
227
+ - Cart items have location-specific pricing and availability
228
+ - Fulfillment options are tied to specific addresses
229
+ - Delivery fees and shipping costs depend on location
230
+ - Without a valid address, cart operations would fail or show incorrect data
231
+
232
+ **Events fired:**
233
+ - `lce:actions.address_cleared` - Address successfully cleared
234
+ - `lce:actions.cart_reset` - Cart successfully reset
235
+
236
+ **Use cases:**
237
+ - Guest checkout option (clear previous user's data)
238
+ - Location change (start fresh with new address)
239
+ - Privacy compliance (complete data removal)
240
+ - Testing/development (reset to clean state)
241
+
215
242
  **Real Business Uses:**
216
243
  - **One-Click Address**: Let customers select from saved Google Places
217
244
  - **Custom Address Forms**: Build your own address input forms with full control
@@ -2,6 +2,27 @@
2
2
 
3
3
  Common issues and solutions for the LiquidCommerce Elements SDK.
4
4
 
5
+ ## Address Management Issues
6
+
7
+ ### Address Clear Behavior
8
+
9
+ **Question:** What happens when I call `actions.address.clear()`?
10
+
11
+ **Answer:** The `actions.address.clear()` action performs a comprehensive reset:
12
+
13
+ - ✅ **Address Data**: Removes all saved address information
14
+ - ✅ **Cart Contents**: Completely resets the cart (removes all items, totals, promo codes)
15
+ - ✅ **Local Storage**: Completely removes the localStorage entry and its value
16
+ - ✅ **Database**: Deletes the persisted store from the server database
17
+ - ✅ **Checkout State**: Resets any pending checkout information
18
+
19
+ **Why does it reset the cart?**
20
+ Cart items have location-specific pricing, availability, and fulfillment options. Without a valid address, cart operations would fail or show incorrect data. The reset ensures data integrity.
21
+
22
+ **Events fired:**
23
+ - `lce:actions.address_cleared` - Address successfully cleared
24
+ - `lce:actions.cart_reset` - Cart successfully reset
25
+
5
26
  ## SDK Initialization Issues
6
27
 
7
28
  ### SDK Not Loading
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.4.4",
6
+ "version": "2.4.5",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",