Produccio estable amb API PHP, HTTPS net i formularis corregits
This commit is contained in:
+4
-1
@@ -102,13 +102,16 @@ function normalizeProduct(array $p): array
|
||||
$priceText = number_format($priceNumber, 2, ',', '.') . ' €';
|
||||
}
|
||||
|
||||
$image = normalizeText($p['image_url'] ?? $p['IMAGE_URL'] ?? '');
|
||||
$filename = basename($image);
|
||||
|
||||
return [
|
||||
'product_code' => normalizeText($p['product_code'] ?? $p['Product Code'] ?? $p['PRODUCT CODE'] ?? ''),
|
||||
'model' => normalizeText($p['model'] ?? $p['MODEL'] ?? ''),
|
||||
'category' => normalizeText($p['category'] ?? $p['CATEGORIA'] ?? $p['CATEGORY'] ?? ''),
|
||||
'colors' => normalizeText($p['colors'] ?? $p['COLORS'] ?? $p['VIDRE'] ?? ''),
|
||||
'description' => normalizeText($p['description'] ?? $p['DESCRIPCIO'] ?? $p['DESCRIPTION'] ?? ''),
|
||||
'image_url' => normalizeText($p['image_url'] ?? $p['IMAGE_URL'] ?? ''),
|
||||
'image_url' => $filename ? "https://kapvoe-portfoli.treblarella.org/assets/products/$filename" : '',
|
||||
'stock' => normalizeStock($p['stock'] ?? $p['STOCK'] ?? 0),
|
||||
'top_vendes' => normalizeBool($p['top_vendes'] ?? $p['TOP_VENDES'] ?? false),
|
||||
'europe_price_number' => $priceNumber,
|
||||
|
||||
Reference in New Issue
Block a user