@liquidcommerce/elements-sdk 2.5.6-beta.4 → 2.5.7
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 +10 -81
- package/dist/index.esm.js +9106 -9155
- package/dist/types/interfaces/core.interface.d.ts +1 -3
- package/docs/CONFIGURATION.md +1 -20
- package/package.json +1 -1
- package/umd/elements.js +1 -1
|
@@ -66,9 +66,7 @@ export interface ILiquidCommerceElementsUIMethod {
|
|
|
66
66
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
67
67
|
floatingCartButton(showItemsCount?: boolean): void;
|
|
68
68
|
cartSubtotal(elementId: string): void;
|
|
69
|
-
cartItemsCount(elementId: string
|
|
70
|
-
hideZero: boolean;
|
|
71
|
-
}): void;
|
|
69
|
+
cartItemsCount(elementId: string): void;
|
|
72
70
|
}
|
|
73
71
|
export interface ILiquidCommerceElementsActions {
|
|
74
72
|
product: IProductActions;
|
package/docs/CONFIGURATION.md
CHANGED
|
@@ -329,16 +329,8 @@ data-cart-button="below:#main-navigation" <!-- Place below the target -->
|
|
|
329
329
|
data-cart-button="below:main-navigation" <!-- Also works without # prefix -->
|
|
330
330
|
data-cart-button="replace:.old-cart" <!-- Replace the target -->
|
|
331
331
|
data-cart-button="inside:.header .nav" <!-- Place inside the target (default) -->
|
|
332
|
-
|
|
333
|
-
<!-- Floating cart button (no badge) -->
|
|
334
|
-
data-cart-button="" <!-- Empty value = floating button -->
|
|
335
332
|
```
|
|
336
333
|
|
|
337
|
-
**Smart Fallback Behavior:**
|
|
338
|
-
- If the target element is not found, automatically falls back to floating cart button
|
|
339
|
-
- If attribute is present but empty (`data-cart-button=""`), creates floating cart button without badge
|
|
340
|
-
- Element IDs are automatically prefixed with `#` if needed (e.g., `header-cart` becomes `#header-cart`)
|
|
341
|
-
|
|
342
334
|
#### `data-cart-badge-button`
|
|
343
335
|
|
|
344
336
|
**Type:** `string`
|
|
@@ -359,17 +351,8 @@ data-cart-badge-button="above:.header .logo" <!-- Place above the target --
|
|
|
359
351
|
data-cart-badge-button="below:#main-navigation" <!-- Place below the target -->
|
|
360
352
|
data-cart-badge-button="replace:.old-cart" <!-- Replace the target -->
|
|
361
353
|
data-cart-badge-button="inside:.header .nav" <!-- Place inside the target (default) -->
|
|
362
|
-
|
|
363
|
-
<!-- Floating cart button with badge (default) -->
|
|
364
|
-
data-cart-badge-button="" <!-- Empty value = floating button with badge -->
|
|
365
354
|
```
|
|
366
355
|
|
|
367
|
-
**Smart Fallback Behavior:**
|
|
368
|
-
- If the target element is not found, automatically falls back to floating cart button with badge
|
|
369
|
-
- If attribute is present but empty (`data-cart-badge-button=""`), creates floating cart button with badge
|
|
370
|
-
- Element IDs are automatically prefixed with `#` if needed
|
|
371
|
-
- If neither `data-cart-button` nor `data-cart-badge-button` is provided, defaults to floating cart button with badge
|
|
372
|
-
|
|
373
356
|
**Position Prefixes:**
|
|
374
357
|
- `above:` - Place above the target element
|
|
375
358
|
- `below:` - Place below the target element
|
|
@@ -380,14 +363,12 @@ data-cart-badge-button="" <!-- Empty value = floating button w
|
|
|
380
363
|
|
|
381
364
|
**Type:** flag (no value)
|
|
382
365
|
|
|
383
|
-
Hide cart button completely.
|
|
366
|
+
Hide cart button completely.
|
|
384
367
|
|
|
385
368
|
```html
|
|
386
369
|
data-cart-button-hidden
|
|
387
370
|
```
|
|
388
371
|
|
|
389
|
-
**Important:** When this attribute is present, the SDK will skip all cart button setup, including floating buttons. This takes precedence over `data-cart-button` and `data-cart-badge-button` attributes.
|
|
390
|
-
|
|
391
372
|
### Cart Button Examples
|
|
392
373
|
|
|
393
374
|
**Simple cart button (no badge):**
|
package/package.json
CHANGED