@anker-in/shopify-react 0.1.1-beta.13 → 0.1.1-beta.15
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/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +8 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +8 -4
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-C77lIEQZ.d.ts → index-Bfg4hT-O.d.ts} +2 -10
- package/dist/{index-CO_fgrFV.d.mts → index-DGaexgLe.d.mts} +2 -10
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -4
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +1 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/{types-DpxtE_nv.d.mts → types-DX-2ABDs.d.mts} +4 -1
- package/dist/{types-DpxtE_nv.d.ts → types-DX-2ABDs.d.ts} +4 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -977,7 +977,7 @@ function useRemoveCartCodes(options) {
|
|
|
977
977
|
// src/hooks/cart/use-add-to-cart.ts
|
|
978
978
|
function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
979
979
|
const { client, config, locale, cartCookieAdapter, userAdapter } = useShopify();
|
|
980
|
-
const { cart } = useCartContext();
|
|
980
|
+
const { cart, addCustomAttributes } = useCartContext();
|
|
981
981
|
const { trigger: applyCartCodes } = useApplyCartCodes();
|
|
982
982
|
const { trigger: removeInvalidCodes } = useRemoveCartCodes();
|
|
983
983
|
const { trigger: addCartLines2 } = useAddCartLines();
|
|
@@ -991,7 +991,8 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
991
991
|
buyerIdentity,
|
|
992
992
|
needCreateCart = false,
|
|
993
993
|
onCodesInvalid,
|
|
994
|
-
replaceExistingCodes
|
|
994
|
+
replaceExistingCodes,
|
|
995
|
+
customAttributes
|
|
995
996
|
} = arg;
|
|
996
997
|
if (!lineItems || lineItems.length === 0) {
|
|
997
998
|
return;
|
|
@@ -1036,6 +1037,9 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
1036
1037
|
discountCodes
|
|
1037
1038
|
});
|
|
1038
1039
|
}
|
|
1040
|
+
if (customAttributes && customAttributes.length > 0) {
|
|
1041
|
+
addCustomAttributes(customAttributes);
|
|
1042
|
+
}
|
|
1039
1043
|
if (withTrack) {
|
|
1040
1044
|
trackAddToCartGA({
|
|
1041
1045
|
lineItems,
|
|
@@ -2674,7 +2678,7 @@ var useUpdatePlusMemberDeliveryOptions = ({
|
|
|
2674
2678
|
const { deliveryData } = arg;
|
|
2675
2679
|
const firstDeliveryGroup = currentCart?.deliveryGroups?.[0];
|
|
2676
2680
|
const deliveryGroupId = firstDeliveryGroup?.id;
|
|
2677
|
-
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option;
|
|
2681
|
+
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option?.code;
|
|
2678
2682
|
if (!deliveryGroupId || !selectedOptionCode || selectedOptionCode === firstDeliveryGroup?.selectedDeliveryOption?.code) {
|
|
2679
2683
|
return null;
|
|
2680
2684
|
}
|
|
@@ -2799,7 +2803,7 @@ function useAddPlusMemberProductsToCart({
|
|
|
2799
2803
|
if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
|
|
2800
2804
|
return void 0;
|
|
2801
2805
|
}
|
|
2802
|
-
if (
|
|
2806
|
+
if (profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
|
|
2803
2807
|
return void 0;
|
|
2804
2808
|
}
|
|
2805
2809
|
return selectedPlusMemberProduct;
|