diff --git a/src/components/CProductCard/CProductCard.ts b/src/components/CProductCard/CProductCard.ts index 1b851d87..29943531 100755 --- a/src/components/CProductCard/CProductCard.ts +++ b/src/components/CProductCard/CProductCard.ts @@ -43,7 +43,8 @@ export default defineComponent({ const myorder = ref({ idapp: process.env.APP_ID, quantity: 0, - idStorehouse: '' + idStorehouse: '', + idProvider: '' }) const myproduct = ref({}) @@ -166,8 +167,8 @@ export default defineComponent({ } function getQtyWarn() { - if (myorder.value.quantity > 0){ - return t('ecomm.di_cui_x_in_carrello', {qty: myorder.value.quantity}) + if (myorder.value.quantity > 0) { + return t('ecomm.di_cui_x_in_carrello', { qty: myorder.value.quantity }) } return '' } @@ -196,12 +197,13 @@ export default defineComponent({ if (myproduct.value.storehouses && myproduct.value.storehouses.length === 1) { myorder.value.idStorehouse = myproduct.value.storehouses[0]._id } + + const ord = products.getOrderProductInCart(myproduct.value._id) + if (ord) { + myorder.value.quantity = ord.quantity + } } - const ord = products.getOrderProductInCart(myproduct.value._id) - if (ord) { - myorder.value.quantity = ord.quantity - } } @@ -209,8 +211,8 @@ export default defineComponent({ return (props.complete) ? 'my-card-big' : 'my-card-prod' } - function getclimg() { - return (props.complete) ? 'myimgtitle centermydiv' : 'centermydiv' + function getclimgproduct() { + return 'myimgproduct centermydiv' } function enableSubQty() { @@ -229,7 +231,7 @@ export default defineComponent({ addtoCart, iconWhishlist, getmycardcl, - getclimg, + getclimgproduct, getnumstore, getSingleStorehouse, getStorehouses, diff --git a/src/components/CProductCard/CProductCard.vue b/src/components/CProductCard/CProductCard.vue index 6231df96..87749499 100755 --- a/src/components/CProductCard/CProductCard.vue +++ b/src/components/CProductCard/CProductCard.vue @@ -1,7 +1,7 @@