diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index a08dad32..79df99d5 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -1670,7 +1670,7 @@ const msg_it = { }, ecomm: { already_in_cart: 'Questo prodotto è stato già aggiunto al Carrello', - area_personale: 'Devi prima accedere alla tua Area Personale', + area_personale: 'Per poter fare un Ordine occorre essere Registrate ed accedere con le proprie credenziali (username e password)', prodotto: 'prodotto', prodotti: 'prodotti', prod_sul_carrello: '{qty} {strprod} sul Carrello', diff --git a/src/store/Products.ts b/src/store/Products.ts index 27f13423..97aa72b4 100755 --- a/src/store/Products.ts +++ b/src/store/Products.ts @@ -107,7 +107,7 @@ export const useProducts = defineStore('Products', { catprods: [], subcatprods: [], productInfos: [], - userActive: {username: '', name: '', surname: '', _id: ''}, + userActive: { username: '', name: '', surname: '', _id: '' }, }), getters: { @@ -419,7 +419,7 @@ export const useProducts = defineStore('Products', { this.userActive = trovato else this.userActive = userStore.my - + ris = await Api.SendReq('/products', 'POST', { userId: this.userActive._id }) .then((res) => { @@ -575,6 +575,9 @@ export const useProducts = defineStore('Products', { if (!globalStore.site.confpages.enableEcommerce) return null + if (!this.userActive._id) + return null + // if (this.userActive._id === '') { // return new Types.AxiosError(0, null, 0, '') // } @@ -759,6 +762,9 @@ export const useProducts = defineStore('Products', { if (!globalStore.site.confpages.enableEcommerce) return null + if (!this.userActive._id) + return null + let ris = null ris = await Api.SendReq('/cart/' + this.userActive._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions() }) @@ -1032,7 +1038,7 @@ export const useProducts = defineStore('Products', { this.products = [] this.orders = [] this.cart = { items: [], totalPrice: 0, totalQty: 0, userId: '' } - + this.loadOrders() this.loadProducts() }