How To Hide Subcategories From Main Content Of Category Page

Hello,

Can anyone tells me how to hide categories from Main content Categories pages. When I have categories in the left sidebar I do not need categories to be displayed in Main Content too.

Thank you

Hello,

Can anyone tells me how to hide categories from Main content Categories pages. When I have categories in the left sidebar I do not need categories to be displayed in Main Content too.

Thank you

It requires some code modification. Please specify in more details where you want to hide categories (any screenshots are appreciated).

Yes I suppose that requires modification. I want to activate Category Tree Block on the left and of course I do not need to have the same categories in the Main Content. (I think it will be good CS-cart developers to make this categories hidden when we have Category Tree Block activated)

SShot.jpg

design/themes/YOUR_THEME/templates/views/categories/view.tpl

Just delete or comment out the following code:

{if $subcategories}
    {math equation="ceil(n/c)" assign="rows" n=$subcategories|count c=$columns|default:"2"}
    {split data=$subcategories size=$rows assign="splitted_subcategories"}
    
{/if}

If you are familiar with hooks, use the categories:view hook to override the template

Thank you :)

If there is someone else who need this, please make a note here.
Probably we will add an option for this.

If there is someone else who need this, please make a note here.
Probably we will add an option for this.

Yes, it will be very useful.

Thank you

Try this. Create templates/addons/my_changes/hooks/categories/view.pre.tpl with this code:

{$subcategories = false scope=parent}

Remember to disable and enable my_changes to pick up the new hook.

You might need to add this style to your less file if you don't have products in the category and don't want the no products message:

[id|="category_products"] .ty-no-items {
    display: none;
}

Edit: added [id|="category_products] to the style as ty-no-items is used in lots of places.

Try this. Create templates/addons/my_changes/hooks/categories/view.pre.tpl with this code:

{$subcategories = false scope=parent}

Remember to disable and enable my_changes to pick up the new hook.

You might need to add this style to your less file if you don't have products in the category and don't want the no products message:

[id|="category_products"] .ty-no-items {
    display: none;
}

Edit: added [id|="category_products] to the style as ty-no-items is used in lots of places.

Thank you, Straygecko.

If there is someone else who need this, please make a note here.
Probably we will add an option for this.

Hi Imac,

I also find it interesting.

Regards,

Yes, it will be nice to be able to hide subcategories.

Yes, it will be nice to be able to hide subcategories.

We are working on such module. PM me to get good offer

You may also look at this thread:

http://forum.cs-cart.com/topic/46051-aligning-sub-category-names-in-a-six-column-layout/?view=findpost&p=259807

By adding this CSS code into the theme editors custom CSS tab you can also hide the sub-categories. Perhaps that eCom Labs could create an addon that let's you display the categories dependend on the width of screen resolution ??

@media (max-width: 680px) 
{
    .ty-subcategories__item
    {
        display: none;
    }
}

Perhaps that eCom Labs could create an addon that let's you display the categories dependend on the width of screen resolution ??

No, it does not check screen resolution, but have some useful features:

https://www.ecom-labs.com/ready-to-use-add-ons/cs-cart-category-layout-add-on.html

hello everyone,

i weant to create somewhat like like

http://prntscr.com/fghip6
please help me

thanks

hello everyone,

i weant to create somewhat like like

http://prntscr.com/fghip6
please help me

thanks

There are several solutions on the marketplace. Search by "mega menu"