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,
|
||||
];
|
||||
|
||||
@@ -96,5 +96,5 @@ onMounted(() => {
|
||||
if (backButton.isVisible.value) {
|
||||
backButton.hide();
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<div class="lg:col-span-2 lg:border-r lg:pr-8">
|
||||
<h1 class="text-2xl font-bold tracking-tight sm:text-3xl">{{ product.name }}</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-sm font-medium">{{ product.manufacturer }}</h3>
|
||||
</div>
|
||||
|
||||
<!-- Options -->
|
||||
<div class="mt-4 lg:row-span-3 lg:mt-0">
|
||||
|
||||
Reference in New Issue
Block a user