Merge pull request #1559 from Safelite/feature/CSR-1813-bugfix-ajc

Feature/CSR-1813 bugfix ajc
This commit is contained in:
AdamCaouetteSafelite 2023-11-21 16:52:10 -05:00 committed by GitHub
commit b4fd57bfe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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