Does anyone know how to display the manufacturer name of the product in the cart, checkout and order emails? I've added 'manufacturer' => $product_query->row['manufacturer_id'] to system/library/cart.php however only the manufacturer ID number is showing up when I call it in the cart.tpl file. I'm guessing that I need to query the database in the $product_query function of the cart.php file but I'm not sure how to go about it.
Any help would be very much appreciated!
Cheers
This could be accomplished as an OCMod. However, since you're using an older version of OC, you'd need to edit your catalog/controller/checkout/cart.php file.
Find:
add above:
Then, find:
add above:
Then, find:
Add below:
Then, in your catalog/language/<your_language>/checkout/cart.php file,
add at the bottom of the file (above ?>):
Then, in your catalog/view/theme/<your_theme>/template/checkout/cart.tpl file, you could use in the $product foreach loop these two variables where you want to display:
This should resolved the issue.
Find:
Code: Select all
$this->data['products'] = array();
Code: Select all
$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
$this->load->model('catalog/manufacturer');
$this->load->model('catalog/product');
Code: Select all
$this->data['products'][] = array(
Code: Select all
$product_info = $this->model_catalog_product->getProduct($product['product_id']);
$manufacturer_info = array();
if ($product_info) {
$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
}
Code: Select all
'model' => $product['model'],
Code: Select all
'manufacturer' => ($manufacturer_info ? html_entity_decode($manufacturer_info['name'], ENT_QUOTES, 'UTF-8') : ''),
add at the bottom of the file (above ?>):
Code: Select all
$_['text_manufacturer'] = 'Manufacturer:';
Code: Select all
<?php echo $text_manufacturer; ?> <?php echo $product['manufacturer']; ?>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 309 guests