fix problema sul caricamento della home da offline...

This commit is contained in:
Surya Paolo
2024-01-17 20:30:17 +01:00
parent c4e2b76d65
commit 2c1fb42399
2 changed files with 10 additions and 4 deletions

View File

@@ -1670,7 +1670,7 @@ const msg_it = {
}, },
ecomm: { ecomm: {
already_in_cart: 'Questo prodotto è stato già aggiunto al Carrello', 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', prodotto: 'prodotto',
prodotti: 'prodotti', prodotti: 'prodotti',
prod_sul_carrello: '{qty} {strprod} sul Carrello', prod_sul_carrello: '{qty} {strprod} sul Carrello',

View File

@@ -107,7 +107,7 @@ export const useProducts = defineStore('Products', {
catprods: [], catprods: [],
subcatprods: [], subcatprods: [],
productInfos: [], productInfos: [],
userActive: {username: '', name: '', surname: '', _id: ''}, userActive: { username: '', name: '', surname: '', _id: '' },
}), }),
getters: { getters: {
@@ -575,6 +575,9 @@ export const useProducts = defineStore('Products', {
if (!globalStore.site.confpages.enableEcommerce) if (!globalStore.site.confpages.enableEcommerce)
return null return null
if (!this.userActive._id)
return null
// if (this.userActive._id === '') { // if (this.userActive._id === '') {
// return new Types.AxiosError(0, null, 0, '') // return new Types.AxiosError(0, null, 0, '')
// } // }
@@ -759,6 +762,9 @@ export const useProducts = defineStore('Products', {
if (!globalStore.site.confpages.enableEcommerce) if (!globalStore.site.confpages.enableEcommerce)
return null return null
if (!this.userActive._id)
return null
let ris = null let ris = null
ris = await Api.SendReq('/cart/' + this.userActive._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions() }) ris = await Api.SendReq('/cart/' + this.userActive._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions() })