- aggiornamento catalogo: lista titoli del catalogo
- scheda prodotto libro - migliorata tabella prodotto
This commit is contained in:
@@ -549,11 +549,18 @@ export const useProducts = defineStore('Products', {
|
||||
|
||||
async getProductById(id: string): Promise<IProduct> {
|
||||
let prod = null
|
||||
if (!this.products) {
|
||||
// Se non lo carico all'avvio, allora fai la chiamata al server
|
||||
prod = await this.loadProductById(id)
|
||||
} else {
|
||||
prod = this.products.find((prod: IProduct) => prod._id === id)
|
||||
try {
|
||||
if (!id) {
|
||||
return null
|
||||
}
|
||||
if (!this.products) {
|
||||
// Se non lo carico all'avvio, allora fai la chiamata al server
|
||||
prod = await this.loadProductById(id)
|
||||
} else {
|
||||
prod = this.products.find((prod: IProduct) => prod._id === id)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Err', e)
|
||||
}
|
||||
|
||||
return prod ? prod : getRecordProductEmpty()
|
||||
@@ -1419,6 +1426,7 @@ export const useProducts = defineStore('Products', {
|
||||
descrizione_completa_macro += addstrcontinua
|
||||
}
|
||||
|
||||
const descr_trafiletto_catalogo = myproduct.productInfo.descr_trafiletto_catalogo || '';
|
||||
const short_descr = myproduct.productInfo.descrizione_breve_macro || '';
|
||||
const descrizione_breve_macro = short_descr.length > maxDescriptionLength
|
||||
? short_descr.substring(0, short_descr.lastIndexOf(' ', maxDescriptionLength)) + '...'
|
||||
@@ -1468,6 +1476,7 @@ export const useProducts = defineStore('Products', {
|
||||
'{prezzo_scontato}': prezzo_scontato || '',
|
||||
'{descrizione_completa_macro}': descrizione_completa_macro || '',
|
||||
'{descrizione_breve_macro}': descrizione_breve_macro || '',
|
||||
'{descr_trafiletto_catalogo}': descr_trafiletto_catalogo || '',
|
||||
'{link_macro}': link_macro || '',
|
||||
'{qta}': qta || '',
|
||||
'{image_link}': image_link || '',
|
||||
|
||||
Reference in New Issue
Block a user