diff --git a/services/targo-hub/lib/store.js b/services/targo-hub/lib/store.js index a87d9ed..99f7867 100644 --- a/services/targo-hub/lib/store.js +++ b/services/targo-hub/lib/store.js @@ -166,8 +166,8 @@ a{color:inherit}
{{ p.name }}
- - + +
@@ -189,7 +189,7 @@ a{color:inherit}
{{ sel.desc }}
- {{ money(sel.sum) }}{{ money(curPrice) }} + {{ money(sel.sum) }}{{ money(sel.reg) }} {{ money(curPrice) }}
{{ stockLabel }}
@@ -402,7 +402,7 @@ async function nameOf (code) { async function buildCatalog () { const items = await erp.list('Item', { filters: [['show_in_store', '=', 1], ['disabled', '=', 0]], - fields: ['name', 'item_name', 'item_group', 'image', 'description', 'standard_rate', 'has_variants', 'variant_of'], + fields: ['name', 'item_name', 'item_group', 'image', 'description', 'standard_rate', 'has_variants', 'variant_of', 'store_regular_price'], limit: 200, }) const bundles = await erp.list('Product Bundle', { fields: ['name'], limit: 200 }) @@ -434,6 +434,7 @@ async function buildCatalog () { const prices = info.map(v => v.price).filter(n => n > 0) const baseP = prices.length ? Math.min(...prices) : (round2(it.standard_rate) || 0) p.base = baseP + const rg = round2(it.store_regular_price); if (rg > baseP) p.reg = rg const attrNames = [...new Set(info.flatMap(v => v.attrs.map(a => a.attribute)))] p.options = attrNames.map(an => { const isColor = /couleur|color/i.test(an) @@ -452,6 +453,7 @@ async function buildCatalog () { } else { p.base = (await priceOf(it.name)) || round2(it.standard_rate) || 0 p.stock = await stockOf(it.name) + const rg = round2(it.store_regular_price); if (rg > p.base) p.reg = rg } out.push(p) }