Display brand as link

  • Posts: 73
  • Thank you received: 2
9 years 9 months ago #223335

-- url of the page with the problem -- : right.travelsat.com.au/browse-products/a...onal-satellite-meter
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Firefox 41.0.2
-- Error-message(debug-mod must be tuned on) -- : No message

Hello,
I am trying to implement showing brands at product page. Currently I am using following code for this:

$db =& JFactory::getDBO();
      $query = 'select category_name from '.hikashop_table('category').' where category_id = '.$this->element->product_manufacturer_id;
      $db->setQuery($query);
      $brand = $db->loadResult();
if ($brand != NULL) {
      echo '<span class="h_brands">Brand: '.$brand.'</span>';
	}
This code shows brand name, but I'd like to make brand name as link - I'd like to show user all products of the same brand when user clicks on brand name. How it's possible to implement?

Last edit: 9 years 9 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 9 months ago #223367

Hi,

It's actually quite easy to do.
Turn on the "Display the manufacturer" setting of the HikaShop configuration and that should do it automatically.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 2
9 years 9 months ago #223521

It was already enabled, but there was an template override for the view used for displaying product and there was no code for displaying brands. I've had a look at original hikashop view file and restored code that was rendering brand. Thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum