ui.shipaid.com 0.3.143 → 0.3.145
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/dist/widget.es.js
CHANGED
|
@@ -3909,7 +3909,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
3909
3909
|
try {
|
|
3910
3910
|
if (this.useCustomStoreFront && this.cartId) {
|
|
3911
3911
|
const result = await this.runStoreFrontQuery(
|
|
3912
|
-
"query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags }
|
|
3912
|
+
"query getCart($cartId: ID!){ cart( id: $cartId ) { id createdAt updatedAt lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags } } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } }",
|
|
3913
3913
|
{ cartId: this.cartId }
|
|
3914
3914
|
);
|
|
3915
3915
|
const cart2 = formatCartDataItems(result.cart);
|
|
@@ -4004,7 +4004,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
4004
4004
|
let cart;
|
|
4005
4005
|
if (this.useCustomStoreFront) {
|
|
4006
4006
|
const cartItemAdded = await this.runStoreFrontQuery(
|
|
4007
|
-
"mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags }
|
|
4007
|
+
"mutation AddItemToCart($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags } } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",
|
|
4008
4008
|
{
|
|
4009
4009
|
cartId: this.cartId,
|
|
4010
4010
|
lines: [
|
|
@@ -4059,7 +4059,7 @@ const _ShipAidWidget = class _ShipAidWidget extends s$1 {
|
|
|
4059
4059
|
let cart;
|
|
4060
4060
|
if (this.useCustomStoreFront) {
|
|
4061
4061
|
const cartItemUpdated = await this.runStoreFrontQuery(
|
|
4062
|
-
"mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags }
|
|
4062
|
+
"mutation RemoveItemToCart($cartId: ID!, $lines: [CartLineUpdateInput!]!) { cartLinesUpdate(cartId: $cartId, lines: $lines) { cart { id lines(first: 10) { edges { node { id quantity merchandise { ... on ProductVariant { id sku product { tags } } } cost{ totalAmount{ amount currencyCode } } } } } cost { totalAmount { amount currencyCode } subtotalAmount { amount currencyCode } } } } }",
|
|
4063
4063
|
{
|
|
4064
4064
|
cartId: this.cartId,
|
|
4065
4065
|
lines: [
|
|
@@ -5760,6 +5760,7 @@ class ShipAidCheckoutPlus extends s$1 {
|
|
|
5760
5760
|
this._desiredProtection = false;
|
|
5761
5761
|
this.isDetailsOpen = false;
|
|
5762
5762
|
this._uiMode = "legacy";
|
|
5763
|
+
this._hasCheckoutButtons = true;
|
|
5763
5764
|
this._toggleId = `shipaid-cp-toggle-${Math.random().toString(36).slice(2, 8)}`;
|
|
5764
5765
|
this._hasRenderedLegacyOnce = false;
|
|
5765
5766
|
this._observer = null;
|
|
@@ -6003,6 +6004,7 @@ class ShipAidCheckoutPlus extends s$1 {
|
|
|
6003
6004
|
console.warn("[ShipAid] Plan is not active, skipping widget mount");
|
|
6004
6005
|
return false;
|
|
6005
6006
|
}
|
|
6007
|
+
if (!this._hasCheckoutButtons) return false;
|
|
6006
6008
|
return ((_a = this._store.checkoutPlus) == null ? void 0 : _a.enabled) === true;
|
|
6007
6009
|
}
|
|
6008
6010
|
updated(changed) {
|
|
@@ -6195,7 +6197,10 @@ class ShipAidCheckoutPlus extends s$1 {
|
|
|
6195
6197
|
} catch {
|
|
6196
6198
|
}
|
|
6197
6199
|
}
|
|
6198
|
-
if (!matches.length)
|
|
6200
|
+
if (!matches.length) {
|
|
6201
|
+
this._hasCheckoutButtons = false;
|
|
6202
|
+
return;
|
|
6203
|
+
}
|
|
6199
6204
|
if (this.isClone) {
|
|
6200
6205
|
const target = matches[0];
|
|
6201
6206
|
this._originalCheckoutButton = target;
|
|
@@ -7074,6 +7079,9 @@ __decorateClass$1([
|
|
|
7074
7079
|
__decorateClass$1([
|
|
7075
7080
|
t$3()
|
|
7076
7081
|
], ShipAidCheckoutPlus.prototype, "_uiMode");
|
|
7082
|
+
__decorateClass$1([
|
|
7083
|
+
t$3()
|
|
7084
|
+
], ShipAidCheckoutPlus.prototype, "_hasCheckoutButtons");
|
|
7077
7085
|
__decorateClass$1([
|
|
7078
7086
|
n$7({ type: String, attribute: "items-selector" })
|
|
7079
7087
|
], ShipAidCheckoutPlus.prototype, "itemsSelector");
|