+ {{ getQtyWarn() }}
-
- {{
- $t('ecomm.qta_in_attesa', {
- qty: myproduct.QuantitaOrdinateInAttesa,
- })
- }}
+
+ {{
+ $t('ecomm.qta_in_attesa', {
+ qty: myproduct.QuantitaOrdinateInAttesa,
+ })
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ myorder.quantity }}
-
-
-
-
-
-
-
-
+
+
-
-
-
- {{ myorder.quantity }}
+
+
+
+
+
+
+ {{ t('products.ritiro_presso') }}:
+
+
+
+
+
+
+
+ {{
+ getSingleStorehouse()
+ }}
-
-
-
-
-
-
-
-
-
- {{ t('products.ritiro_presso') }}:
-
-
-
-
-
-
-
- {{
- getSingleStorehouse()
- }}
-
-
-
-
-
+
+
diff --git a/src/components/CSingleCart/CSingleCart.scss b/src/components/CSingleCart/CSingleCart.scss
index 1a458cd4..4f761b1c 100755
--- a/src/components/CSingleCart/CSingleCart.scss
+++ b/src/components/CSingleCart/CSingleCart.scss
@@ -14,3 +14,8 @@
height: 50px;
width: 50px;
}
+
+.ordine_scontato_barrato{
+ text-decoration: line-through;
+ color: gray;
+}
\ No newline at end of file
diff --git a/src/components/CSingleCart/CSingleCart.ts b/src/components/CSingleCart/CSingleCart.ts
index a7c4aea2..d0886fbe 100755
--- a/src/components/CSingleCart/CSingleCart.ts
+++ b/src/components/CSingleCart/CSingleCart.ts
@@ -61,6 +61,14 @@ export default defineComponent({
})
}
+ function isApplicatoSconto() {
+ const totalipotetico = order.value.price! * order.value.quantity
+ if (totalipotetico > order.value.TotalPriceProduct!) {
+ return true
+ }
+ return false
+ }
+
function removeFromCard() {
products.removeFromCart({ order: order.value })
}
@@ -69,6 +77,7 @@ export default defineComponent({
myimgclass,
addsubqty,
removeFromCard,
+ isApplicatoSconto,
}
},
})
diff --git a/src/components/CSingleCart/CSingleCart.vue b/src/components/CSingleCart/CSingleCart.vue
index 385eab0c..92081d2a 100755
--- a/src/components/CSingleCart/CSingleCart.vue
+++ b/src/components/CSingleCart/CSingleCart.vue
@@ -28,7 +28,10 @@
- € {{ (order.price * order.quantity) ? (order.price * order.quantity).toFixed(2) : 0 }}
+
+ € {{ (order.price * order.quantity).toFixed(2) }}
+
+ € {{ order.TotalPriceProduct ? order.TotalPriceProduct.toFixed(2) : 0 }}
diff --git a/src/model/Products.ts b/src/model/Products.ts
index 0817bdb3..bfcaa892 100755
--- a/src/model/Products.ts
+++ b/src/model/Products.ts
@@ -17,7 +17,7 @@ export interface IProduct {
description?: string,
department?: string,
category?: string,
- price?: number,
+ price: number,
after_price?: string,
color?: string,
size?: string,
@@ -48,7 +48,8 @@ export interface IOrder {
idProvider?: string
idStorehouse?: string
idScontisticas?: string[]
- price?: number
+ price: number
+ TotalPriceProduct: number
after_price?: string
color?: string
size?: string
diff --git a/src/store/Products.ts b/src/store/Products.ts
index 004172d9..6a191b58 100755
--- a/src/store/Products.ts
+++ b/src/store/Products.ts
@@ -44,7 +44,7 @@ export const useProducts = defineStore('Products', {
getProduct: (state: IProductsState) => (code: string): IProduct => {
const prod = state.products.find((prod: IProduct) => prod.code === code)
- return prod ? prod : { active: false, img: '', code: '', name: '', storehouses: [], scontisticas: [] }
+ return prod ? prod : { active: false, img: '', code: '', name: '', storehouses: [], scontisticas: [], price: 0 }
},
getCart: (state: IProductsState) => (): ICart => {
@@ -127,7 +127,7 @@ export const useProducts = defineStore('Products', {
},
getOrdersCartByIdProduct: (state: IProductsState) => (idproduct: string): IOrderCart[] | [] => {
- console.log('getOrdersCartByIdProduct')
+ // console.log('getOrdersCartByIdProduct')
// console.log('.cart.items', this.cart.items)
try {
if (state.orders) {
@@ -137,7 +137,7 @@ export const useProducts = defineStore('Products', {
return item.order.idProduct === idproduct
})
})
- console.log('Ordini ', ris)
+ // console.log('Ordini ', ris)
return ris ? ris : []
}
} catch (e) {
@@ -210,6 +210,7 @@ export const useProducts = defineStore('Products', {
idProduct: product._id,
idProducer: product.idProducer,
status: shared_consts.OrderStatus.IN_CART,
+ TotalPriceProduct: 0,
price: product.price,
after_price: product.after_price,
color: product.color,