diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts
index 913d3596..e31f1675 100755
--- a/src/common/shared_vuejs.ts
+++ b/src/common/shared_vuejs.ts
@@ -33,28 +33,28 @@ export const shared_consts = {
Units_Of_Measure_ListBox: [
{
label: '[Nessuno]',
- value: 0,
short: '',
+ value: 0,
},
{
label: 'Grammi (g)',
- value: 1,
short: 'g',
+ value: 1,
},
{
label: 'Chili (kg)',
+ short: 'Kg',
value: 2,
- short: 'kg',
},
{
- label: 'Litri (l)',
+ label: 'Litri (L)',
+ short: 'L',
value: 3,
- short: 'lt',
},
{
label: 'Pezzi (p)',
+ short: 'p',
value: 4,
- short: 'pz',
},
],
diff --git a/src/components/CMyCart/CMyCart.ts b/src/components/CMyCart/CMyCart.ts
index 19e9dd37..7fbdec51 100755
--- a/src/components/CMyCart/CMyCart.ts
+++ b/src/components/CMyCart/CMyCart.ts
@@ -55,6 +55,10 @@ export default defineComponent({
products.loadOrders()
}
+ function existsOrders() {
+ return products.getNumOrders() > 0
+ }
+
onMounted(mounted)
return {
@@ -64,6 +68,8 @@ export default defineComponent({
numOrders,
closecart,
getnumItemsCart,
+ existsOrders,
+ globalStore,
}
},
})
diff --git a/src/components/CMyCart/CMyCart.vue b/src/components/CMyCart/CMyCart.vue
index 7a5797d0..9009dd9e 100755
--- a/src/components/CMyCart/CMyCart.vue
+++ b/src/components/CMyCart/CMyCart.vue
@@ -4,23 +4,27 @@
@@ -28,12 +32,31 @@
-
+
+
+
+
diff --git a/src/components/CProductCard/CProductCard.ts b/src/components/CProductCard/CProductCard.ts
index edaa2af5..f276ba09 100755
--- a/src/components/CProductCard/CProductCard.ts
+++ b/src/components/CProductCard/CProductCard.ts
@@ -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,
}
}
})
diff --git a/src/components/CProductCard/CProductCard.vue b/src/components/CProductCard/CProductCard.vue
index a49af567..ed955537 100755
--- a/src/components/CProductCard/CProductCard.vue
+++ b/src/components/CProductCard/CProductCard.vue
@@ -1,5 +1,5 @@
-
+
- {{ getQtyAvailable() }}
+ {{ products.getQtyAvailable(myproduct) }}
{{ getQtyWarn() }}
@@ -200,7 +200,7 @@
@@ -214,7 +214,7 @@
- {{ getQtyBookableAvailable() }}
+ {{ products.getQtyBookableAvailable(myproduct) }}
{{
@@ -269,11 +269,11 @@
@@ -294,10 +294,10 @@
diff --git a/src/components/CSingleCart/CSingleCart.scss b/src/components/CSingleCart/CSingleCart.scss
index a83252ab..d7bd536f 100755
--- a/src/components/CSingleCart/CSingleCart.scss
+++ b/src/components/CSingleCart/CSingleCart.scss
@@ -7,11 +7,11 @@
}
.imgNormal{
- height: 80px;
+ height: 110px !important;
width: 80px;
}
.imgSmall{
- height: 50px;
+ height: 60px !important;
width: 50px;
}
@@ -34,4 +34,12 @@
.gasordine {
font-style: italic;
color: blue;
+}
+
+.prezzo_singolo{
+ font-style: italic;
+}
+
+.q-item__section--thumbnail img{
+ height: 100px;
}
\ No newline at end of file
diff --git a/src/components/CSingleCart/CSingleCart.vue b/src/components/CSingleCart/CSingleCart.vue
index d9344c49..824a2f50 100755
--- a/src/components/CSingleCart/CSingleCart.vue
+++ b/src/components/CSingleCart/CSingleCart.vue
@@ -1,100 +1,130 @@
-
-
-
-
-
-
-
- {{ products.getSingleGasordine(order, true) }}
-
- {{ order.product.productInfo.name }}
+
+
+
+
+
-
-
-
-
-
-
- {{ order.quantity }}
-
-
- + {{ t('ecomm.preord') }}:
-
-
-
- {{ order.quantitypreordered }}
-
-
-
-
- {{ tools.getWeightTotalByOrder(order) }}
- {{ tools.getUnitsMeasure(order.product.productInfo.unit, true) }}
-
-
-
- € {{
- order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0
- }}
-
- (€
- {{
- (
- order.price * order.quantity +
- order.price * order.quantitypreordered
- ).toFixed(2)
- }})
-
- {{
- $t('ecomm.sconto_applicato', { risparmio: getRisparmio() })
- }}
-
-
-
-
-
+
diff --git a/src/components/CTitleBanner/CTitleBanner.vue b/src/components/CTitleBanner/CTitleBanner.vue
index 55d8489a..7f24cd85 100755
--- a/src/components/CTitleBanner/CTitleBanner.vue
+++ b/src/components/CTitleBanner/CTitleBanner.vue
@@ -7,7 +7,7 @@
dense
:class="
bgcolor +
- ` cursor-pointer q-my-sm ` +
+ ` cursor-pointer q-mx-sm ` +
clcolor +
` ` +
myclass +
diff --git a/src/components/MyHeader/MyHeader.scss b/src/components/MyHeader/MyHeader.scss
index 091c4453..0eec2cb6 100755
--- a/src/components/MyHeader/MyHeader.scss
+++ b/src/components/MyHeader/MyHeader.scss
@@ -315,3 +315,7 @@ canvas {
.titlesite {
font-size: 1rem;
}
+
+.q-drawer-cart{
+ width: 350px !important;
+}
\ No newline at end of file
diff --git a/src/components/MyHeader/MyHeader.vue b/src/components/MyHeader/MyHeader.vue
index 179559c6..56b229cb 100755
--- a/src/components/MyHeader/MyHeader.vue
+++ b/src/components/MyHeader/MyHeader.vue
@@ -52,7 +52,9 @@
-
{{ getappname() }}
+
+ {{ getappname() }}
+
(): number => {
+ return state.orders.length
+ },
+
getOrdersCart: (state: IProductsState) => (tipoord: number): IOrderCart[] | undefined => {
console.log('state.orders', state.orders)
if (tipoord === shared_consts.OrderStat.IN_CORSO.value)
@@ -321,7 +325,7 @@ export const useProducts = defineStore('Products', {
after_price: product.after_price,
quantity: order.quantity,
quantitypreordered: order.quantitypreordered,
- idStorehouse: order.idStorehouse,
+ idStorehouse: order.idStorehouse,
}
return myorder
@@ -510,7 +514,9 @@ export const useProducts = defineStore('Products', {
subqty: !addqty,
order: ordcart,
}).then((res: any) => {
- if (res && res.risult) {
+ if (res && res.msgerr) {
+ return res;
+ } else if (res && res.risult) {
order.quantity = res.myord.quantity
order.quantitypreordered = res.myord.quantitypreordered
}
@@ -557,7 +563,7 @@ export const useProducts = defineStore('Products', {
}
this.updateDataProduct(res)
- return { risult: !!res, myord: res.data.myord }
+ return { risult: !!res, myord: res.data.myord, msgerr: res.data.msgerr }
})
.catch((error) => {
console.log('error addToCart', error)
@@ -583,10 +589,10 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + userStore.my._id, 'POST', { addqty, subqty, order })
- .then((res) => {
+ .then((res: any) => {
this.updateDataProduct(res)
- return { risult: !!res, myord: res.data.myord }
+ return { risult: !!res, myord: res.data.myord, msgerr: res.msgerr }
})
.catch((error) => {
console.log('error addSubQtyToItem', error)
@@ -690,38 +696,42 @@ export const useProducts = defineStore('Products', {
return await this.addToCart({ product, order, addqty })
.then((ris) => {
- let strprod = t('ecomm.prodotto')
-
- let msg = ''
- console.log('ris', ris)
- if (ris && ris.myord == null) {
- msg = t('ecomm.prodotto_tolto')
- tools.showNotif($q, msg)
- return
- }
- if (ris === null || ris.myord == null) {
- msg = t('ecomm.error_cart')
- tools.showNegativeNotif($q, msg)
- return
+ if (ris && ris.msgerr) {
+ tools.showNegativeNotif($q, ris.msgerr)
} else {
+ let strprod = t('ecomm.prodotto')
- let qta = ris.myord.quantity + ris.myord.quantitypreordered
- if (qta > 1 || qta === 0)
- strprod = t('ecomm.prodotti')
-
- if (qta > 0) {
- msg = t('ecomm.prod_sul_carrello', { strprod, qty: qta })
+ let msg = ''
+ console.log('ris', ris)
+ if (ris && ris.myord == null) {
+ msg = t('ecomm.prodotto_tolto')
+ tools.showNotif($q, msg)
+ return
}
+ if (ris === null || ris.myord == null) {
+ msg = t('ecomm.error_cart')
+ tools.showNegativeNotif($q, msg)
+ return
+ } else {
+
+ let qta = ris.myord.quantity + ris.myord.quantitypreordered
+ if (qta > 1 || qta === 0)
+ strprod = t('ecomm.prodotti')
+
+ if (qta > 0) {
+ msg = t('ecomm.prod_sul_carrello', { strprod, qty: qta })
+ }
+
+ }
+ if (ris === null || ris.myord.quantity === 0)
+ tools.showNotif($q, msg)
+ else
+ tools.showPositiveNotif($q, msg)
+
}
-
//updateproduct()
- if (ris === null || ris.myord.quantity === 0)
- tools.showNotif($q, msg)
- else
- tools.showPositiveNotif($q, msg)
-
return ris
})
},
@@ -783,7 +793,68 @@ export const useProducts = defineStore('Products', {
} catch (e) {
return ''
}
- }
+ },
+
+ getQtyAvailable(myproduct: IProduct): number {
+ let qty = myproduct.quantityAvailable!
+ return qty
+ },
+
+ getQtyBookableAvailable(myproduct: IProduct): number {
+ let qty = myproduct.bookableAvailableQty!
+ return qty
+ },
+
+ enableSubQty(myorder: IOrder): boolean {
+ let qty = myorder.quantity + myorder.quantitypreordered
+ return qty ? qty > 0 : false
+ },
+
+ enableAddQty(myorder: IOrder, myproduct: IProduct): boolean {
+ const globalStore = useGlobalStore()
+ if (globalStore.site.ecomm && globalStore.site.ecomm.enablePreOrders) {
+ return (this.getQtyBookableAvailable(myproduct) > 0
+ && (myproduct.maxBookableQty === 0
+ || (myorder.quantitypreordered + 1 < myproduct.maxBookableQty))
+ )
+ || (this.getQtyAvailable(myproduct) > 0)
+ && (myproduct.maxBookableQty === 0
+ || (myorder.quantity + 1 < myproduct.maxBookableQty))
+
+ } else {
+ return (this.getQtyAvailable(myproduct) > 0)
+ && (myproduct.maxBookableQty === 0
+ || (myorder.quantity + 1 < myproduct.maxBookableQty))
+ }
+
+ },
+
+ qtaNextAdd(myorder: IOrder, myproduct: IProduct): number {
+ let step = 1
+ if (this.getQtyAvailable(myproduct) > 0) {
+ if (myorder.quantity === 0)
+ step = myproduct.minBuyQty | 1
+ } else {
+ if (myorder.quantitypreordered === 0)
+ step = myproduct.minBuyQty | 1
+ }
+
+ return step
+ },
+
+ qtaNextSub(myorder: IOrder, myproduct: IProduct) {
+ let step = 1
+ let minqta = myproduct.minBuyQty | 1
+ if (this.getQtyAvailable(myproduct) > 0) {
+ if (myorder.quantity === minqta)
+ step = minqta
+ } else {
+ if (myorder.quantitypreordered === minqta)
+ step = minqta
+ }
+
+ return step
+ },
},
diff --git a/upload/products/5600872803133.jpg b/upload/products/5600872803133.jpg
new file mode 100644
index 00000000..3d6b6c41
Binary files /dev/null and b/upload/products/5600872803133.jpg differ
diff --git a/upload/products/8017977043550.jpg b/upload/products/8017977043550.jpg
new file mode 100644
index 00000000..c72ce247
Binary files /dev/null and b/upload/products/8017977043550.jpg differ