Carrello con scontistica aggiornata

This commit is contained in:
Surya Paolo
2023-12-18 12:11:22 +01:00
parent 265c8f4d9e
commit c1d60a7260
8 changed files with 41 additions and 13 deletions

View File

@@ -87,7 +87,6 @@ export default defineComponent({
return false
}
products.addToCart({ product: myproduct.value, order: myorder, addqty: add }).then((ris) => {
let strprod = t('ecomm.prodotto')
@@ -226,7 +225,7 @@ export default defineComponent({
}
function enableAddQty() {
if (site.value.ecomm!.enablePreOrders) {
if (site.value.ecomm && site.value.ecomm.enablePreOrders) {
return true
} else {
return getQtyAvailable() > 0

View File

@@ -18,4 +18,13 @@
.ordine_scontato_barrato{
text-decoration: line-through;
color: gray;
}
.ordine_scontato_nuovo{
font-size: 1.1rem;
font-weight: bold;
}
.ordine_scritta_sconto{
font-style: italic;
color: green;
font-weight: bold;
}

View File

@@ -62,8 +62,8 @@ export default defineComponent({
}
function isApplicatoSconto() {
const totalipotetico = order.value.price! * order.value.quantity
if (totalipotetico > order.value.TotalPriceProduct!) {
const totalipotetico = order.value.price * order.value.quantity
if (totalipotetico > order.value.TotalPriceProduct) {
return true
}
return false

View File

@@ -1,5 +1,5 @@
<template>
<div class="q-pa-xs q-gutter-xs">
<div v-if="order && order.product" class="q-pa-xs q-gutter-xs">
<div v-if="order.product" class="row items-center justify-evenly no-wrap">
<div class="col-2 text-h6 ellipsis">
@@ -31,7 +31,8 @@
<div v-if="isApplicatoSconto()">
<span class="ordine_scontato_barrato">&nbsp; {{ (order.price * order.quantity).toFixed(2) }}</span>
</div>
&nbsp;{{ order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0 }}
<span v-if="isApplicatoSconto()" class="ordine_scritta_sconto">{{ $t('ecomm.sconto_applicato') }}</span>
<span :class="isApplicatoSconto() ? 'ordine_scontato_nuovo' : ''">&nbsp;{{ order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0 }}</span>
</div>
<div class="col-1">
<q-btn v-if="!nomodif" icon="fas fa-times" color="negative" round size="xs" @click="removeFromCard">