Updated logic for displaying PIA options or alert for time of service

This commit is contained in:
Leah Schumann 2024-06-28 08:20:38 -04:00
parent d67fb0d1b2
commit e6b296b3a1

View file

@ -22,6 +22,7 @@
<hr class="my-0" />
<cart
ref="cart"
:damage="damageInfo"
:availableVaps="availableVaps"
:allowItemRemoval="true"
@ -46,12 +47,12 @@
</div>
<paymentMethodQuestion
v-if="!isPiaDisabled"
v-if="isPiaEnabled && totalAmountDue > 0.00"
v-model="paymentMethodInternalModel"
validationRules="option-required" />
<alert
v-if="!isPiaDisabled"
v-if="!isPiaEnabled && totalAmountDue > 0.00"
:isDismissible="false"
alertClass="alert-info"
cmsWidgetName="NoPiaDisclaimerWidget"
@ -512,6 +513,7 @@ export default {
hasSubmittedOrder() {
return this.$store.getters.hasSubmittedOrder;
},
},
computed: {
damageInfo() {
@ -571,18 +573,24 @@ export default {
return null;
}
},
isPiaDisabled() {
totalAmountDue() {
return baseMixin.methods.getAmountDue(this.lineItems)
},
isPiaEnabled() {
const piaExperience = this.getSettingValue(experimentSettings.PIA_EXPERIENCE);
const piaInsurance = this.getSettingValue(experimentSettings.PIA_INSURANCE);
var isEnabled = false;
if (this.isInsurance) {
isEnabled = piaInsurance === "true" && this.currentDeductible > 0;
return piaInsurance === "true";
} else {
isEnabled = piaExperience === "PIA Optional" || piaExperience === "PIA Required";
return piaExperience === "PIA Optional" || piaExperience === "PIA Required";
}
// if (this.totalAmountDue > 0.00) {
return !isEnabled;
// }
//return false;
},
paymentMethod() {
if (this.isPiaDisabled) {
@ -643,7 +651,7 @@ export default {
},
},
components: {
funnelHeader,
funnelHeader,
navbar,
funnelSubHeader,
Form,