@moonbase.sh/storefront 3.7.0 → 3.8.1
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 +22 -0
- package/dist/moonbase.d.ts +17 -0
- package/dist/moonbase.js +3703 -3631
- package/dist/moonbase.umd.cjs +17 -17
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -297,6 +297,28 @@ offer claimed from a card does. A buyer can already put a multi-target offer on
|
|
|
297
297
|
product and never add the other, so nothing here is a cart they couldn't have built
|
|
298
298
|
by hand.
|
|
299
299
|
|
|
300
|
+
`cart.minimumTotal` sets the smallest order the cart will check out. Below it, the
|
|
301
|
+
checkout button gives way to a meter of the same size that fills as the cart grows
|
|
302
|
+
and tells the buyer how much more to spend; it turns back into the button once the
|
|
303
|
+
cart reaches the minimum.
|
|
304
|
+
|
|
305
|
+
```ts
|
|
306
|
+
Moonbase.configure({
|
|
307
|
+
cart: {
|
|
308
|
+
minimumTotal: { USD: 25, EUR: 25, GBP: 20 },
|
|
309
|
+
},
|
|
310
|
+
})
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Amounts are keyed by currency code, in major units, because Moonbase picks each
|
|
314
|
+
visitor's currency and the widget never converts one into another. A currency you
|
|
315
|
+
leave out has no minimum. The minimum is measured on the cart's Total, after product
|
|
316
|
+
discounts and offers but before coupons and tax, and a cart holding nothing but free
|
|
317
|
+
items is exempt. The `checkout` intent respects it too: below the minimum it opens
|
|
318
|
+
the cart instead of checking out. The widget enforces this, not the API, so
|
|
319
|
+
`purchase()` and checkouts you build outside the widget are not held to it. A value
|
|
320
|
+
you pass replaces the previous one; pass `{}` to remove it. No minimum by default.
|
|
321
|
+
|
|
300
322
|
You can also control where the widget mounts by providing `target`.
|
|
301
323
|
|
|
302
324
|
## Promotions
|
package/dist/moonbase.d.ts
CHANGED
|
@@ -227,6 +227,7 @@ declare class MoonbaseImpl implements MoonbaseInstance {
|
|
|
227
227
|
add_to_cart(parameters?: MoonbaseIntentArgs['add_to_cart']): Promise<void>;
|
|
228
228
|
purchase(parameters?: MoonbaseIntentArgs['purchase']): Promise<void>;
|
|
229
229
|
checkout(parameters?: MoonbaseIntentArgs['checkout']): void;
|
|
230
|
+
private checkoutCart;
|
|
230
231
|
close_checkout(): void;
|
|
231
232
|
view_about(): void;
|
|
232
233
|
}
|
|
@@ -497,6 +498,22 @@ export declare interface MoonbaseOptions {
|
|
|
497
498
|
leadMagnets: {
|
|
498
499
|
quantity: 'selectable' | 'single';
|
|
499
500
|
};
|
|
501
|
+
/**
|
|
502
|
+
* The smallest order the cart will check out, keyed by currency code in major units, e.g.
|
|
503
|
+
* `{ USD: 25, EUR: 25 }`. Below it the checkout button gives way to a meter showing how much
|
|
504
|
+
* further the buyer has to go, and the `checkout` intent opens the cart instead of checking out.
|
|
505
|
+
*
|
|
506
|
+
* Per currency because the API picks each visitor's currency and the widget never converts one
|
|
507
|
+
* into another. A currency with no entry has no minimum, so a buyer priced in one you did not
|
|
508
|
+
* list checks out as before.
|
|
509
|
+
*
|
|
510
|
+
* Measured on the cart's own Total: after product discounts and offers, before coupons and tax.
|
|
511
|
+
* A cart of nothing but free items is exempt, since there is no purchase to hold back.
|
|
512
|
+
*
|
|
513
|
+
* The widget enforces this, not the API: `purchase()` and checkouts built outside the widget are
|
|
514
|
+
* not held to it. A value you pass replaces the previous one outright; pass `{}` to remove it.
|
|
515
|
+
*/
|
|
516
|
+
minimumTotal: Record<string, number>;
|
|
500
517
|
};
|
|
501
518
|
activation: {
|
|
502
519
|
deviceTokenFileExtension: string;
|