CSR-1813: fix add front wiper button issue

This commit is contained in:
Adam Caouette 2023-11-21 16:29:34 -05:00
parent 7686b9c9ce
commit 750b7c8620

View file

@ -269,7 +269,7 @@ export default {
if (!this.frontWipersInCart) { if (!this.frontWipersInCart) {
if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) { if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
result = wipersOfferedStrings.BOTH; result = wipersOfferedStrings.BOTH;
} else { } else if (!this.frontWipersInCart && this.wipersModal?.frontWiperLineItems.length > 0) {
result = wipersOfferedStrings.FRONT; result = wipersOfferedStrings.FRONT;
} }
} else if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) { } else if (!this.rearWipersInCart && this.wipersModal?.rearWiperLineItems.length > 0) {
@ -289,6 +289,10 @@ export default {
}; };
const modalData = getAnswer("WipersModal", this.answersCmsData); const modalData = getAnswer("WipersModal", this.answersCmsData);
// remove custom var for now
modalData.Text = modalData.Text?.replaceAll("{custom:WIPERTYPE}", "");
if (this.wipersOffered === wipersOfferedStrings.BOTH) { if (this.wipersOffered === wipersOfferedStrings.BOTH) {
// NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON // NO REAR WIPERS or FRONT WIPERS IN CART; SHOW COMBO BUTTON
const prices = [ const prices = [
@ -334,8 +338,8 @@ export default {
"AddRearBladesQuestionWidget", "AddRearBladesQuestionWidget",
"QuestionText" "QuestionText"
); );
const frontWipersLineItems = this.wipersModal.frontWiperLineItems; const frontWipersLineItems = this.wipersModal?.frontWiperLineItems;
const rearWipersLineItems = this.wipersModal.rearWiperLineItems; const rearWipersLineItems = this.wipersModal?.rearWiperLineItems;
if (frontWipersLineItems) { if (frontWipersLineItems) {
const wipersOption = { const wipersOption = {