- Aggiornamento template mail (tramite i campi in HTML)
- Aggiornato Carrello
This commit is contained in:
@@ -192,16 +192,6 @@ export default defineComponent({
|
||||
return false
|
||||
}
|
||||
|
||||
function getQtyAvailable() {
|
||||
let qty = myproduct.value.quantityAvailable!
|
||||
return qty
|
||||
}
|
||||
|
||||
function getQtyBookableAvailable() {
|
||||
let qty = myproduct.value.bookableAvailableQty!
|
||||
return qty
|
||||
}
|
||||
|
||||
function getQtyWarn() {
|
||||
if (myorder.quantity > 0) {
|
||||
return t('ecomm.di_cui_x_in_carrello', { qty: myorder.quantity })
|
||||
@@ -274,55 +264,6 @@ export default defineComponent({
|
||||
return 'myimgproduct centermydiv'
|
||||
}
|
||||
|
||||
function enableSubQty() {
|
||||
let qty = myorder.quantity + myorder.quantitypreordered
|
||||
return qty ? qty > 0 : false
|
||||
}
|
||||
|
||||
function enableAddQty() {
|
||||
if (site.value.ecomm && site.value.ecomm.enablePreOrders) {
|
||||
return (getQtyBookableAvailable() > 0
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantitypreordered + 1 < myproduct.value.maxBookableQty))
|
||||
)
|
||||
|| (getQtyAvailable() > 0)
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantity + 1 < myproduct.value.maxBookableQty ))
|
||||
|
||||
} else {
|
||||
return (getQtyAvailable() > 0)
|
||||
&& (myproduct.value.maxBookableQty === 0
|
||||
|| (myorder.quantity + 1 < myproduct.value.maxBookableQty ))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function qtaNextAdd() {
|
||||
let step = 1
|
||||
if (getQtyAvailable() > 0) {
|
||||
if (myorder.quantity === 0)
|
||||
step = myproduct.value.minBuyQty | 1
|
||||
} else {
|
||||
if (myorder.quantitypreordered === 0)
|
||||
step = myproduct.value.minBuyQty | 1
|
||||
}
|
||||
|
||||
return step
|
||||
}
|
||||
|
||||
function qtaNextSub() {
|
||||
let step = 1
|
||||
let minqta = myproduct.value.minBuyQty | 1
|
||||
if (getQtyAvailable() > 0) {
|
||||
if (myorder.quantity === minqta)
|
||||
step = minqta
|
||||
} else {
|
||||
if (myorder.quantitypreordered === minqta)
|
||||
step = minqta
|
||||
}
|
||||
|
||||
return step
|
||||
}
|
||||
|
||||
function visuListDisponibili() {
|
||||
openlistorders.value = true
|
||||
@@ -362,9 +303,6 @@ export default defineComponent({
|
||||
t,
|
||||
storeSelected,
|
||||
gasordineSelected,
|
||||
enableSubQty,
|
||||
enableAddQty,
|
||||
getQtyAvailable,
|
||||
getQtyWarn,
|
||||
openlistorders,
|
||||
func_tools,
|
||||
@@ -375,12 +313,9 @@ export default defineComponent({
|
||||
shared_consts,
|
||||
site,
|
||||
getQtyWarnPreOrdered,
|
||||
getQtyBookableAvailable,
|
||||
listord,
|
||||
sumval,
|
||||
getGasordines,
|
||||
qtaNextAdd,
|
||||
qtaNextSub,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="q-pa-md row items-start q-gutter-md">
|
||||
<div class="row items-start q-gutter-md">
|
||||
<q-spinner v-if="!endload" color="primary" size="3em" :thickness="2" />
|
||||
|
||||
<q-card
|
||||
@@ -163,7 +163,7 @@
|
||||
<q-item
|
||||
v-if="
|
||||
cosa === shared_consts.PROD.BOTTEGA ||
|
||||
(cosa === shared_consts.PROD.GAS && getQtyAvailable() > 0)
|
||||
(cosa === shared_consts.PROD.GAS && products.getQtyAvailable(myproduct) > 0)
|
||||
"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? visuListDisponibili() : null"
|
||||
@@ -178,7 +178,7 @@
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="prod_disp">
|
||||
{{ getQtyAvailable() }}
|
||||
{{ products.getQtyAvailable(myproduct) }}
|
||||
</span>
|
||||
<div class="prod_qtywarn">
|
||||
{{ getQtyWarn() }}
|
||||
@@ -200,7 +200,7 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="getQtyBookableAvailable() > 0 || myproduct.bookableQty > 0"
|
||||
v-if="products.getQtyBookableAvailable(myproduct) > 0 || myproduct.bookableQty > 0"
|
||||
:clickable="tools.isManager()"
|
||||
@click="tools.isManager() ? visuListBookable() : null"
|
||||
>
|
||||
@@ -214,7 +214,7 @@
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<span class="prod_preorder">
|
||||
{{ getQtyBookableAvailable() }}
|
||||
{{ products.getQtyBookableAvailable(myproduct) }}
|
||||
</span>
|
||||
<div class="prod_qtywarn">
|
||||
<span v-if="getQtyWarnPreOrdered()">{{
|
||||
@@ -269,11 +269,11 @@
|
||||
<div class="row q-mb-sm no-wrap items-center centeritems">
|
||||
<q-btn
|
||||
icon="fas fa-cart-arrow-down"
|
||||
:color="enableSubQty() ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !enableSubQty()"
|
||||
:color="products.enableSubQty(myorder) ? 'negative' : 'grey'"
|
||||
:disable="checkifCartDisable() || !products.enableSubQty(myorder)"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.subcart', { qta: qtaNextSub() })"
|
||||
:label="t('products.subcart', { qta: products.qtaNextSub(myorder, myproduct) })"
|
||||
@click="addtoCart(false)"
|
||||
>
|
||||
</q-btn>
|
||||
@@ -294,10 +294,10 @@
|
||||
<q-btn
|
||||
icon-right="fas fa-cart-plus"
|
||||
color="positive"
|
||||
:disable="checkifCartDisable() || !enableAddQty()"
|
||||
:disable="checkifCartDisable() || !products.enableAddQty(myorder, myproduct)"
|
||||
rounded
|
||||
size="md"
|
||||
:label="t('products.addcart', { qta: qtaNextAdd() })"
|
||||
:label="t('products.addcart', { qta: products.qtaNextAdd(myorder, myproduct) })"
|
||||
@click="addtoCart(true)"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
Reference in New Issue
Block a user