fix problema sul caricamento della home da offline...
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
@@ -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: {
|
||||||
@@ -419,7 +419,7 @@ export const useProducts = defineStore('Products', {
|
|||||||
this.userActive = trovato
|
this.userActive = trovato
|
||||||
else
|
else
|
||||||
this.userActive = userStore.my
|
this.userActive = userStore.my
|
||||||
|
|
||||||
|
|
||||||
ris = await Api.SendReq('/products', 'POST', { userId: this.userActive._id })
|
ris = await Api.SendReq('/products', 'POST', { userId: this.userActive._id })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
@@ -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() })
|
||||||
@@ -1032,7 +1038,7 @@ export const useProducts = defineStore('Products', {
|
|||||||
this.products = []
|
this.products = []
|
||||||
this.orders = []
|
this.orders = []
|
||||||
this.cart = { items: [], totalPrice: 0, totalQty: 0, userId: '' }
|
this.cart = { items: [], totalPrice: 0, totalQty: 0, userId: '' }
|
||||||
|
|
||||||
this.loadOrders()
|
this.loadOrders()
|
||||||
this.loadProducts()
|
this.loadProducts()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user