Produccio estable amb API PHP, HTTPS net i formularis corregits

This commit is contained in:
2026-04-08 13:00:36 +02:00
parent 7d0fea670f
commit 70a20938ac
4 changed files with 38 additions and 14 deletions
+4 -1
View File
@@ -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,