Merge pull request #1751 from Safelite/feature/CSR-1952-ajc-try2

[DO NOT MERGE] - CSR-1952: add missing strike-through price vs discount promo price feature
This commit is contained in:
Mark Harris 2024-02-14 06:11:52 -05:00 committed by GitHub
commit bbbc66f124
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,11 @@
<span>
{{ getFormattedAmount("", packagePrice) }}
</span>
<span
v-if="packagePriceWithoutDiscount > packagePrice"
class="struck-out-price">
{{ getFormattedAmount("", packagePriceWithoutDiscount) }}
</span>
</div>
<!-- Packaged Cart Items -->
@ -174,6 +179,17 @@ export default {
return subTotal;
},
getPromoDiscounts() {
const promoItems = this.promoCartItems;
let subTotal = 0;
promoItems?.forEach((item) => {
subTotal += item.subTotal;
});
return subTotal;
},
getVapsCartItemsForSelectedPackage(packageName) {
const packageContentTypes = getPackageContents(
this.glassToReplace,
@ -354,6 +370,12 @@ export default {
return packagePrice;
},
packagePriceWithoutDiscount() {
let fullPrice = this.packagePrice;
let discount = this.getPromoDiscounts();
fullPrice += Math.abs(discount);
return fullPrice;
},
isRepair() {
if (!this.damage) {
return;
@ -887,6 +909,10 @@ export default {
background-color: $gray-100;
align-items: center;
}
.struck-out-price {
text-decoration: line-through;
padding-left: 0.5rem;
}
.packaged-cart-item {
background-color: $gray-100;
padding-left: 2.5rem;