@anker-in/shopify-react 0.1.1-beta.3 → 0.1.1-beta.4
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.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +1 -1
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +1 -1
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/hooks/index.js
CHANGED
|
@@ -409,7 +409,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
|
409
409
|
return { qualifyingGift: null, nextTierGoal: null };
|
|
410
410
|
}
|
|
411
411
|
const giftTiers = activeCampaign.rule_result.spend_get_reward.gift_product;
|
|
412
|
-
const qualifyingTier = [...giftTiers].
|
|
412
|
+
const qualifyingTier = [...giftTiers].sort((a, b) => Number(b.spend_sum_money) - Number(a.spend_sum_money)).find((tier) => subtotal >= Number(tier.spend_sum_money));
|
|
413
413
|
const nextGoal = giftTiers.find((tier) => subtotal < Number(tier.spend_sum_money));
|
|
414
414
|
if (!qualifyingTier) {
|
|
415
415
|
return { qualifyingGift: null, nextTierGoal: nextGoal || null };
|