feat: add manufacturer to product view
This commit is contained in:
@@ -134,6 +134,7 @@ class ProductsHandler
|
||||
'products.price' => 'price',
|
||||
'products.image' => 'product_image',
|
||||
'products.tax_class_id' => 'tax_class_id',
|
||||
'manufacturer.name' => 'product_manufacturer',
|
||||
])
|
||||
->from(db_table('product'), 'products')
|
||||
->join(
|
||||
@@ -143,6 +144,12 @@ class ProductsHandler
|
||||
->where('product_description.language_id', '=', $languageId);
|
||||
}
|
||||
)
|
||||
->join(
|
||||
db_table('manufacturer') . ' AS manufacturer',
|
||||
function (JoinClause $join) use ($languageId) {
|
||||
$join->on('products.manufacturer_id', '=', 'manufacturer.manufacturer_id');
|
||||
}
|
||||
)
|
||||
->where('products.product_id', '=', $productId)
|
||||
->limit(1)
|
||||
->firstOrNull();
|
||||
@@ -185,6 +192,7 @@ class ProductsHandler
|
||||
'id' => $product['product_id'],
|
||||
'name' => $product['product_name'],
|
||||
'description' => html_entity_decode($product['product_description']),
|
||||
'manufacturer' => $product['product_manufacturer'],
|
||||
'price' => $price,
|
||||
'images' => $images,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user