diff --git a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue index bf0359b37..8cc561b03 100644 --- a/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue +++ b/src/layouts/payment-method/promo-modal-question/promo-modal-question.vue @@ -209,21 +209,17 @@ export default { switch (error) { case promoErrorCodes.PROMO_STACKING_NOT_ALLOWED: case promoErrorCodes.SIMILAR_PROMO_ALREADY_ON_ORDER: - if ( - additionalInfo.length === 1 && + return additionalInfo.length === 1 && additionalInfo[0] === this.promoCode.toUpperCase() - ) { - return (this.displaySimilarPromoAlert = true); - } else { - this.errorMessage = this.StackPromoText?.replaceAll( - "{custom:NEWPROMOCODE}", - this.promoCode.toUpperCase() - ).replaceAll( - "{custom:OLDPROMOCODE}", - this.getConflictingPromoCode(additionalInfo) - ); - return (this.displayStackingPromoAlert = true); - } + ? (this.displaySimilarPromoAlert = true) + : ((this.errorMessage = this.StackPromoText?.replace( + /\{custom:(NEW|OLD)PROMOCODE\}/g, + (match, group) => + group === "NEW" + ? this.promoCode.toUpperCase() + : this.getConflictingPromoCode(additionalInfo) + )), + (this.displayStackingPromoAlert = true)); case promoErrorCodes.INVALID_PROMO_ON_ORDER: if (additionalInfo.some((x) => x.toUpperCase() === "APPOINTMENT_TYPE")) { this.errorMessage = this.InShopPromoText?.replaceAll(