- Posts: 640
- Thank you received: 16
Code for displaying Brand Name in product list
- PeterChain
-
Topic Author
- Offline
Less
More
13 years 7 months ago #97758
by PeterChain
Code for displaying Brand Name in product list was created by PeterChain
Some PHP coder need to help in a simple feature:
I want to add Product Brand name in my product listing. I tried some tweak in file list_img_desc.php but I finally accepted that my PHP knowledge is too poor to keep trying forever...
I cloned <!-- PRODUCT NAME --> piece of code and tried several 'mutations' but the best I got is the brand code itself, but not it's name.
Please bring some light to the project
<!-- PRODUCT BRAND -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php } ?>
<?php
echo $this->row->product_name;
?>
<?php if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT BRAND -->
I want to achieve this
I want to add Product Brand name in my product listing. I tried some tweak in file list_img_desc.php but I finally accepted that my PHP knowledge is too poor to keep trying forever...
I cloned <!-- PRODUCT NAME --> piece of code and tried several 'mutations' but the best I got is the brand code itself, but not it's name.
Please bring some light to the project
<!-- PRODUCT BRAND -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php } ?>
<?php
echo $this->row->product_name;
?>
<?php if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT BRAND -->
I want to achieve this
Please Log in or Create an account to join the conversation.
13 years 7 months ago #97841
by Xavier
Replied by Xavier on topic Code for displaying Brand Name in product list
Hi,
To have the brand name you can use:
To have the brand name you can use:
Code:
$db = JFactory::getDBO();
$db->setQuery('SELECT category_name FROM '.hikashop_table('category').' WHERE category_id='.(int)$this->row->product_manufacturer_id);
$brandName = $db->loadResult();
echo $brandName;
The following user(s) said Thank You: PeterChain
Please Log in or Create an account to join the conversation.
Time to create page: 0.053 seconds