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 c03713234..cc070cb0f 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
@@ -16,8 +16,8 @@
customInputId="promoCode"
v-model="promoCode"
cmsWidgetName="PromoQuestionWidget" />
-
-
Promo code "{{ promos }}" applied
+
+ Promo code "{{ promo[i].promoCode }}" applied
0?lineItems:null;
+ const promoValidationResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.VALIDATE_ORDER_PROMO_AND_SAVE_SERVER_DATA,
{
promoCode: promoCode,
- lineItemsToUse: lineItems,
+ lineItemsToUse: lineItemsToUse,
addableVaps: addableVaps,
},
- pageName
+ pageName,false
);
return {
@@ -136,33 +142,27 @@ export default {
},
async addPromoCode() {
if (this.promoCode) {
- this.resetAlerts();
- // const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos(
- // this.promoCode,
- // this.availableLineItems,
- // this.lineItems
- // );
- // this.lineItems.vaps?.push(getVaps);
-
+ this.resetAlerts();
+
const promoCodeData = await this.getPromoCodeData(
this.promoCode,
- this.lineItems,
+ this.modelValue,
this.availableLineItems,
"payment-method"
);
-
+
if (promoCodeData.isValid) {
let promos = [];
promos.push(promoCodeData.promoCode);
const modelValue = this.modelValue;
modelValue.promos = promos;
this.closeModal();
- // const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos(
- // this.promoCode,
- // this.availableLineItems,
- // this.lineItems
- // );
- // this.lineItems.vaps?.push(getVaps);
+ const getVaps = getVapsThatNeedToBeAddedToSatisfyPromos(
+ promoCodeData.promoCode,
+ this.availableLineItems,
+ modelValue
+ );
+ modelValue.vaps?.push(...getVaps);
const message = this.getPromoAddedMessage();
this.$emit("added-to-cart", {
messageHeadline: "Promo Applied!",
@@ -196,12 +196,12 @@ export default {
diff --git a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue
index b9161a938..25744e652 100644
--- a/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue
+++ b/src/layouts/payment-method/promo-modal-question/promo-question/promo-question.vue
@@ -25,7 +25,7 @@ defineRule("promo-required", required(errorMessages.PROMO_REQUIRED));
export default {
name: "promo-question",
props: {
- modelValue:String,
+ modelValue: String,
cmsWidgetName: String,
},
computed: {