how to display on frontend all categories of one product belongs to?

  • Posts: 116
  • Thank you received: 1
1 week 6 days ago #360813

-- HikaShop version -- : 5.0.4
-- Joomla version -- : 5.1
-- PHP version -- : 8.2

Hi,

while i was creating products, i assigned to each product multiple categories, ...for example i used categories for location and type of a product....ie. category1: locationX: , category2: Location Z, category3: typeY, category4: typeW....etc

Now when in the frond-end i open certain product to view it, it doesnt show to which categories does this product belong to, ...how can this be done? each product ahs at least two categories asigned to it...i am not sure if i am clear enough in my explanation :idea:

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
1 week 6 days ago #360818

Hi,

Here are some threads where we talked about this:
www.hikashop.com/support/forum/4-how-to/...-products-pages.html
www.hikashop.com/forum/4-how-to/885271-h...gory-of-product.html
Basically, you can add PHP code like this:

<?php 
  foreach($this->categories as $category){
  echo ($category->category_name).' - ';
  }
  ?>
to the product / show_default view file via the menu Display>Views.

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

Time to create page: 0.040 seconds
Powered by Kunena Forum