diff --git a/ui/src/pages/ProductStockByAttributes.vue b/ui/src/pages/ProductStockByAttributes.vue index 8507ae0..3c6beec 100644 --- a/ui/src/pages/ProductStockByAttributes.vue +++ b/ui/src/pages/ProductStockByAttributes.vue @@ -490,6 +490,7 @@ function resolvePhotoDim1ID(item) { item?.ItemDim1Code, item?.itemDim1Code, item?.ITEMDIM1CODE, + item?.Beden, item?.RenkID, item?.Renk_Id ] @@ -504,7 +505,8 @@ function resolvePhotoDim3ID(item) { const candidates = [ item?.ItemDim3Code, item?.itemDim3Code, - item?.ITEMDIM3CODE + item?.ITEMDIM3CODE, + item?.Renk2 ] for (const value of candidates) { const s = String(value || '').trim() @@ -580,8 +582,6 @@ function resolveProductImageUrl(item) { async function resolveProductImageUrlForCarousel(item) { const resolved = resolveProductImageUrl(item) - const publicUrl = String(resolved.publicUrl || '').trim() - if (publicUrl) return publicUrl const contentUrl = String(resolved.contentUrl || '').trim() if (contentUrl) { try { @@ -596,7 +596,8 @@ async function resolveProductImageUrlForCarousel(item) { // fall through to public url } } - return String(contentUrl || '').trim() + const publicUrl = String(resolved.publicUrl || '').trim() + return String(publicUrl || contentUrl || '').trim() } function getProductImageUrl(code, color, secondColor = '', dim1Id = '', dim3Id = '') { @@ -669,8 +670,8 @@ async function ensureProductImage(code, color, secondColor = '', dim1Id = '', di const resolved = resolveProductImageUrl(first) - productImageCache.value[key] = resolved.publicUrl || resolved.contentUrl || '' - productImageFallbackByKey.value[key] = resolved.publicUrl ? '' : (resolved.contentUrl || '') + productImageCache.value[key] = resolved.contentUrl || resolved.publicUrl || '' + productImageFallbackByKey.value[key] = resolved.contentUrl || '' } catch (err) { console.warn('[ProductStockByAttributes] product image fetch failed', { code, color, err }) productImageCache.value[key] = '' @@ -1152,7 +1153,8 @@ async function openProductCard(grp1, grp2) { colorCode, secondColor, candidateCount: imageCandidates.length, - imageCount: images.length + imageCount: images.length, + firstImages: images.slice(0, 3) }) const uniqueImages = Array.from(new Set(images)) diff --git a/ui/src/pages/ProductStockQuery.vue b/ui/src/pages/ProductStockQuery.vue index 158ceb3..8474c06 100644 --- a/ui/src/pages/ProductStockQuery.vue +++ b/ui/src/pages/ProductStockQuery.vue @@ -483,6 +483,7 @@ function resolvePhotoDim1ID(item) { item?.ItemDim1Code, item?.itemDim1Code, item?.ITEMDIM1CODE, + item?.Beden, item?.RenkID, item?.Renk_Id ] @@ -497,7 +498,8 @@ function resolvePhotoDim3ID(item) { const candidates = [ item?.ItemDim3Code, item?.itemDim3Code, - item?.ITEMDIM3CODE + item?.ITEMDIM3CODE, + item?.Renk2 ] for (const value of candidates) { const s = String(value || '').trim() @@ -567,8 +569,6 @@ function resolveProductImageUrl(item) { async function resolveProductImageUrlForCarousel(item) { const resolved = resolveProductImageUrl(item) - const publicUrl = String(resolved.publicUrl || '').trim() - if (publicUrl) return publicUrl const contentUrl = String(resolved.contentUrl || '').trim() if (contentUrl) { try { @@ -583,7 +583,8 @@ async function resolveProductImageUrlForCarousel(item) { // fall through to public url } } - return String(contentUrl || '').trim() + const publicUrl = String(resolved.publicUrl || '').trim() + return String(publicUrl || contentUrl || '').trim() } function getProductImageUrl(code, color, secondColor = '', dim1Id = '', dim3Id = '') { @@ -653,8 +654,8 @@ async function ensureProductImage(code, color, secondColor = '', dim1Id = '', di const first = list[0] || null const resolved = resolveProductImageUrl(first) - productImageCache.value[key] = resolved.publicUrl || resolved.contentUrl || '' - productImageFallbackByKey.value[key] = resolved.publicUrl ? '' : (resolved.contentUrl || '') + productImageCache.value[key] = resolved.contentUrl || resolved.publicUrl || '' + productImageFallbackByKey.value[key] = resolved.contentUrl || '' } catch (err) { console.warn('[ProductStockQuery] product image fetch failed', { code, color, err }) productImageCache.value[key] = '' @@ -1027,7 +1028,8 @@ async function openProductCard(grp1, grp2) { colorCode, secondColor, candidateCount: imageCandidates.length, - imageCount: images.length + imageCount: images.length, + firstImages: images.slice(0, 3) }) const uniqueImages = Array.from(new Set(images))