Hi,
Everything is written in the title !
So I am looking for a function to display the categories to which each product belongs when it is displayed in the grid view catalog. I would like at the same time to display them on link : clicking on each category will display all the products depending of this category (so a new catalog grid view).
On the dp-products.php file, I implemented this function :
$categories = get_the_category($product->ID);
foreach ($categories as $category)
{
$arrayCat[] = $category->cat_name;
}
if (isset($arrayCat))
$content .= implode (' | ', $arrayCat);
The matter is that the word "array" is displayed with the category name. The categories are duplicated when there are 2 or more products belonging to the same category that are displayed.
And I also don't know how to implement the code for the link.
Someone can help me ?
Thanks