Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-13 14:26:51 +03:00
parent 4a45fa82d9
commit fd7400ee69
2 changed files with 4 additions and 20 deletions

View File

@@ -480,7 +480,6 @@ function extractSecondColor(item) {
return (
normalizeSecondColorValue(item?.Renk2) ||
normalizeSecondColorValue(item?.ItemDim3Code) ||
normalizeSecondColorValue(item?.Yaka) ||
''
)
}
@@ -536,21 +535,12 @@ function resolveProductImageUrl(item) {
const uploadsPath = normalizeUploadsPath(item.storage_path || item.storage || '')
let publicUrl = ''
const thumbFolder = (typeof window !== 'undefined' && window.devicePixelRatio > 1.5)
? 't600'
: 't300'
if (uploadsPath) {
// Thumbnail tercih et
if (uploadsPath.includes('/uploads/image/') && !uploadsPath.includes('/uploads/image/t300/') && !uploadsPath.includes('/uploads/image/t600/')) {
publicUrl = uploadsPath.replace('/uploads/image/', `/uploads/image/${thumbFolder}/`)
} else {
publicUrl = uploadsPath
}
} else {
const fileName = String(item.file_name || item.FileName || '').trim()
if (fileName) {
// b2b benzeri yapi: /uploads/image/t300|t600/<uuid>.jpg
publicUrl = `/uploads/image/${thumbFolder}/${fileName}`
publicUrl = `/uploads/image/${fileName}`
}
}

View File

@@ -473,7 +473,6 @@ function extractSecondColor(item) {
return (
normalizeSecondColorValue(item?.Renk2) ||
normalizeSecondColorValue(item?.ItemDim3Code) ||
normalizeSecondColorValue(item?.Yaka) ||
''
)
}
@@ -525,16 +524,11 @@ function resolveProductImageUrl(item) {
const uploadsPath = normalizeUploadsPath(item.storage_path || item.storage || '')
let publicUrl = ''
const thumbFolder = (typeof window !== 'undefined' && window.devicePixelRatio > 1.5) ? 't600' : 't300'
if (uploadsPath) {
if (uploadsPath.includes('/uploads/image/') && !uploadsPath.includes('/uploads/image/t300/') && !uploadsPath.includes('/uploads/image/t600/')) {
publicUrl = uploadsPath.replace('/uploads/image/', `/uploads/image/${thumbFolder}/`)
} else {
publicUrl = uploadsPath
}
} else {
const fileName = String(item.file_name || item.FileName || '').trim()
if (fileName) publicUrl = `/uploads/image/${thumbFolder}/${fileName}`
if (fileName) publicUrl = `/uploads/image/${fileName}`
}
return { contentUrl, publicUrl }