- Posts: 116
- Thank you received: 1
how to display on frontend all categories of one product belongs to?
2 years 6 months ago #360813
by dado023
-- 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:
-- 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.
2 years 6 months ago #360818
by nicolas
Replied by nicolas on topic how to display on frontend all categories of one product belongs to?
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:
to the product / show_default view file via the menu Display>Views.
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:
Code:
<?php
foreach($this->categories as $category){
echo ($category->category_name).' - ';
}
?>
Please Log in or Create an account to join the conversation.
Time to create page: 0.046 seconds