fix(product): decode html entities for product and category names

This commit is contained in:
2025-09-25 16:33:48 +03:00
parent a381b3a6ee
commit acbfaebcf4
3 changed files with 10 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ class CategoriesHandler
return [
'id' => (int)$category['id'],
'image' => $category['image'] ?? '',
'name' => $category['name'],
'name' => html_entity_decode($category['name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'description' => $category['description'],
'children' => $category['children'],
];
@@ -102,7 +102,7 @@ class CategoriesHandler
$branch[] = [
'id' => (int)$category['id'],
'image' => $image,
'name' => $category['name'],
'name' => html_entity_decode($category['name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'description' => $category['description'],
'children' => $category['children'] ?? [],
];

View File

@@ -154,7 +154,7 @@ class ProductsService
$allImages[] = [
'url' => $image,
'alt' => $product['product_name'],
'alt' => html_entity_decode($product['product_name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
];
$price = $this->currency->format(
@@ -173,7 +173,7 @@ class ProductsService
return [
'id' => (int) $product['product_id'],
'product_quantity' => (int) $product['product_quantity'],
'name' => $product['product_name'],
'name' => html_entity_decode($product['product_name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'price' => $price,
'images' => $allImages,
];
@@ -263,7 +263,7 @@ class ProductsService
),
'width' => $width,
'height' => $height,
'alt' => $product['product_name'],
'alt' => html_entity_decode($product['product_name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
];
} catch (Exception $e) {
$this->logger->logException($e);
@@ -281,9 +281,9 @@ class ProductsService
return [
'id' => $product['product_id'],
'name' => $product['product_name'],
'description' => html_entity_decode($product['product_description']),
'manufacturer' => $product['product_manufacturer'],
'name' => html_entity_decode($product['product_name'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'description' => html_entity_decode($product['product_description'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'manufacturer' => html_entity_decode($product['product_manufacturer'], ENT_QUOTES | ENT_HTML5, 'UTF-8'),
'price' => $price,
'minimum' => $product['minimum'],
'quantity' => $product['quantity'],