|
@@ -146,7 +146,8 @@ function createProductCard(p) {
|
|
|
// if (selectedIds.has(p.item_id)) row.classList.add('selected');
|
|
// if (selectedIds.has(p.item_id)) row.classList.add('selected');
|
|
|
|
|
|
|
|
const left = el('div', 'thumb');
|
|
const left = el('div', 'thumb');
|
|
|
- const img = new Image(); img.src = mediaUrl+p.image_path || p.image || '';
|
|
|
|
|
|
|
+ const img = new Image(); img.src = p.image_path || p.image || '';
|
|
|
|
|
+ // console.log("image path",p.image_path);
|
|
|
img.alt = `${p.product_name} image`;
|
|
img.alt = `${p.product_name} image`;
|
|
|
// console.log("img",img);
|
|
// console.log("img",img);
|
|
|
// img.onerror = () => { img.remove(); const fb = el('div', 'fallback'); fb.textContent = (p.product_name || 'Product').split(' ').map(w => w[0]).slice(0,2).join('').toUpperCase(); left.appendChild(fb); };
|
|
// img.onerror = () => { img.remove(); const fb = el('div', 'fallback'); fb.textContent = (p.product_name || 'Product').split(' ').map(w => w[0]).slice(0,2).join('').toUpperCase(); left.appendChild(fb); };
|
|
@@ -314,7 +315,8 @@ function renderProductsCards(items = getCurrentSlice()) {
|
|
|
// --- Table layout ---
|
|
// --- Table layout ---
|
|
|
function createMiniThumb(p) {
|
|
function createMiniThumb(p) {
|
|
|
const mt = el('div', 'mini-thumb');
|
|
const mt = el('div', 'mini-thumb');
|
|
|
- const img = new Image(); img.src = mediaUrl+p.image_path || p.image || ''; img.alt = `${p.product_name} image`;
|
|
|
|
|
|
|
+ const img = new Image(); img.src = p.image_path || p.image || ''; img.alt = `${p.product_name} image`;
|
|
|
|
|
+ // console.log("image path",p.image_path);
|
|
|
// console.log("img",img);
|
|
// console.log("img",img);
|
|
|
img.onerror = () => { img.src = mediaUrl+"media/images/no-product.png" };
|
|
img.onerror = () => { img.src = mediaUrl+"media/images/no-product.png" };
|
|
|
// img.onerror = () => { img.remove(); const fb = el('div', 'fallback'); fb.textContent = (p.product_name || 'Product').split(' ').map(w => w[0]).slice(0,2).join('').toUpperCase(); mt.appendChild(fb); };
|
|
// img.onerror = () => { img.remove(); const fb = el('div', 'fallback'); fb.textContent = (p.product_name || 'Product').split(' ').map(w => w[0]).slice(0,2).join('').toUpperCase(); mt.appendChild(fb); };
|