Versione 1.2.71:
- sistemato il carrello su GruppoMacro e su PiuCheBuono. - Corretto visualizzazione della scontistica. - Se un prodotto viene cancellato ora lo cancella anche sul carrello.
This commit is contained in:
@@ -140,9 +140,9 @@
|
||||
|
||||
<div
|
||||
class="q-ma-sm q-pa-sm text-h8 text-grey"
|
||||
v-if="globalStore && globalStore.site.ecomm.NoteExtraOnCart"
|
||||
v-if="globalStore && globalStore.site.ecomm?.NoteExtraOnCart"
|
||||
>
|
||||
{{ globalStore.site.ecomm.NoteExtraOnCart }}
|
||||
{{ globalStore.site.ecomm?.NoteExtraOnCart }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-mt-md row justify-center">
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useI18n } from 'vue-i18n';
|
||||
|
||||
import MixinUsers from '../../mixins/mixin-users';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { ICart } from 'app/src/model';
|
||||
import { ICart, IOrderCart } from 'app/src/model';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyCart',
|
||||
@@ -31,6 +31,7 @@ export default defineComponent({
|
||||
const codice_sconto = ref('')
|
||||
const descr_sconto = ref('')
|
||||
const caricamentodati = ref(false)
|
||||
const recOrderCart = ref(<IOrderCart>{});
|
||||
|
||||
const myCart = computed<ICart | null>(() => productStore.cart);
|
||||
const myTotalPrice = computed(() => {
|
||||
@@ -77,8 +78,9 @@ export default defineComponent({
|
||||
globalStore.rightCartOpen = false;
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
productStore.loadOrders();
|
||||
async function mounted() {
|
||||
await productStore.loadOrders();
|
||||
aggiornaCarrello();
|
||||
}
|
||||
|
||||
function existsOrders() {
|
||||
@@ -104,7 +106,7 @@ export default defineComponent({
|
||||
codice_sconto.value = '';
|
||||
descr_sconto.value = '';
|
||||
if (rissconto.mycart) {
|
||||
myCart.value = rissconto.mycart
|
||||
productStore.cart = rissconto.mycart
|
||||
};
|
||||
}
|
||||
} catch (error: any) {
|
||||
@@ -121,6 +123,17 @@ export default defineComponent({
|
||||
await applicaSconto(codice_sconto.value);
|
||||
}
|
||||
|
||||
async function aggiornaCarrello() {
|
||||
if (myCart.value) {
|
||||
recOrderCart.value = await productStore.CreateOrdersCart({
|
||||
cart_id: myCart.value._id,
|
||||
status: 0,
|
||||
note: undefined,
|
||||
codice_sconto: '',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMounted(mounted);
|
||||
|
||||
@@ -140,6 +153,7 @@ export default defineComponent({
|
||||
caricamentodati,
|
||||
descr_sconto,
|
||||
idOrdersCart,
|
||||
recOrderCart,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</q-btn>-->
|
||||
</div>
|
||||
<div
|
||||
v-if="totalPriceIntero"
|
||||
v-if="numOrders > 0 && totalPriceIntero"
|
||||
class="q-mr-sm"
|
||||
>
|
||||
<table class="table">
|
||||
@@ -35,7 +35,7 @@
|
||||
€ {{ totalPriceIntero }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="myCart.codice_sconto">
|
||||
<tr v-if="recOrderCart.codice_sconto">
|
||||
<td class="label">{{ t('ecomm.sconto_appl') }}:</td>
|
||||
<td>
|
||||
<div class="column items-center">
|
||||
@@ -46,13 +46,13 @@
|
||||
size="md"
|
||||
icon="fas fa-tag"
|
||||
>
|
||||
<span class="sconto-text">{{ descr_sconto }}</span>
|
||||
<span class="sconto-text">{{ recOrderCart.descr_sconto }}</span>
|
||||
</q-chip>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr v-if="!myCart.codice_sconto">
|
||||
<tr v-if="!recOrderCart.codice_sconto">
|
||||
<td class="label">{{ t('ecomm.codice_sconto') }}:</td>
|
||||
<td>
|
||||
<q-input
|
||||
@@ -100,7 +100,7 @@
|
||||
<div
|
||||
v-if="numOrders === 0"
|
||||
style="text-align: center"
|
||||
class="text-grey"
|
||||
class="text-grey q-ma-md q-pa-md"
|
||||
>
|
||||
{{ t('ecomm.carrello_vuoto') }}
|
||||
</div>
|
||||
|
||||
@@ -808,14 +808,12 @@
|
||||
</CGallery>
|
||||
</div>
|
||||
<div v-else>
|
||||
img: {{tools.getDirectoryGall(myrow, table, mypath) + myvalue}}
|
||||
|
||||
<div
|
||||
v-if="myvalue"
|
||||
class="text-center"
|
||||
>
|
||||
<q-img
|
||||
:src="tools.getDirectoryGall(myrow, table, mypath) + myvalue"
|
||||
:src="myvalue"
|
||||
class="text-center"
|
||||
style="height: 100px; width: 100px"
|
||||
alt="foto"
|
||||
|
||||
Reference in New Issue
Block a user