possible to display category under product title?

  • Posts: 23
  • Thank you received: 2
10 years 9 months ago #180587

hello. I absolutely love this product and fully intend on purchasing the commercial version in the future. What I am wondering is it possible to display the category under the title of the product in a product listing page? I have played with the appropriate view a bit but cannot get the category to display. Any help is greatly appreciated.

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 9 months ago #180592

Hi,

There is no option to do that but there is one to replace the title of the menu item by the name of the category.
You can do that by editing your menu via the menu Display>Content menus and changing the option "Use menu name instead of
category name for the title".
If you prefer to add the name of the category, you would have to edit the file "listing" of the view "product" via the menu Display>Views and add such code:
<?php echo $this->element->category_name; ?>
But it might be more complex as the same view is used for the modules so it might require some more complex code.

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

  • Posts: 23
  • Thank you received: 2
10 years 9 months ago #180725

You are simply wonderful. I got it working! Would I do something similar to display the manufacturer? I have it displaying the ID but not sure how to get the actual name.


NEVERMIND! I got it!!!!!!! THANK YOU SO MUCH!

Code I used on product listing page to display name of manufacturer:

<?
$db = JFactory::getDBO();
$db->setQuery('SELECT category_name FROM '.hikashop_table('category').' WHERE category_id='.(int)$this->escape($this->row->product_manufacturer_id));
$instructor= $db->loadResult();
echo $instructor?>

Last edit: 10 years 9 months ago by webcandy.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum