Block subcategory products

Phoca Cart - complex e-commerce extension
Xeno
Phoca Member
Phoca Member
Posts: 17
Joined: 21 Feb 2024, 12:11

Block subcategory products

Post by Xeno »

Greetings!
Does anyone have any idea how I could make it so that I can hide the products that appear in the sub and sub-sub and so on categories and only display the sub-(sub-)categories? I tried to dig into the php view files, but I couldn't find

Also, could I somehow display how many products are in each category (sub-category- sub-sub-category....)?

Thank you very much!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Block subcategory products

Post by Jan »

Hi, sorry, I don't fully understand what do you exactly mean?

Jan
If you find Phoca extensions useful, please support the project
Xeno
Phoca Member
Phoca Member
Posts: 17
Joined: 21 Feb 2024, 12:11

Re: Block subcategory products

Post by Xeno »

Hi!
I wanted to make sure that in the main categories, as long as there is a subcategory, the products do not appear there.
I have achieved this:

/components/com_phocacart/views/category/tmpl/default.php

[43. Insert in the row:]
if(!empty($this->loadTemplate('subcategories'))){
//echo "There is a subcategory, I don't display the products...";
}
else{
.....

[520. Insert in the row: only one closing tag]
}

I looked for a better solution, but this was all I could do.

Thx!
Post Reply