@anker-in/shopify-react 0.1.1-beta.13 → 0.1.1-beta.14

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/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,
@@ -2799,7 +2803,7 @@ function useAddPlusMemberProductsToCart({
2799
2803
  if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
2800
2804
  return void 0;
2801
2805
  }
2802
- if (!profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
2806
+ if (profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
2803
2807
  return void 0;
2804
2808
  }
2805
2809
  return selectedPlusMemberProduct;