Skip to content

Commit

Permalink
fix: promotion disabled but still can appliable
Browse files Browse the repository at this point in the history
Signed-off-by: vanpho93 <vanpho02@gmail.com>
  • Loading branch information
vanpho93 committed Jan 16, 2023
1 parent 79a70a0 commit 07008ae
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/api-plugin-promotions/src/handlers/applyPromotions.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ export default async function applyPromotions(context, cart) {

let enhancedCart = enhanceCart(context, pluginPromotions.enhancers, cart);
for (const promotion of unqualifiedPromotions) {
if (!promotion.enabled && canAddToCartMessages(promotion)) {
cartMessages.push(createCartMessage({
title: "The promotion no longer available",
subject: "promotion",
severity: "warning",
metaFields: {
promotionId: promotion._id
}
}));
if (!promotion.enabled) {
if (canAddToCartMessages(promotion)) {
cartMessages.push(createCartMessage({
title: "The promotion no longer available",
subject: "promotion",
severity: "warning",
metaFields: {
promotionId: promotion._id
}
}));
}
continue;
}

Expand Down

0 comments on commit 07008ae

Please sign in to comment.