How To Hide Products From Subcategory And Display Only The Last

Hi, please help!

I need optimize process of add product to site!

as I'm doing now

1. Create a category and after add products in the category

_damicom.md/compresoare-motocompresoare-kaeser-us

2. Create html page

it turns out
_damicom.md/compresoare-motocompresoare-kaeser-us-2

problem: i need automaticaly when add a category and product displayed without products and left panel as in the third picture. After clicking displayed a simple list of products

_damicom.md/compresoare-motocompresoare-kaeser-us/compresoare-cu-urub-kaeser-us

my html code:

 

I understand that it is necessary to change something here: templates / views / categories / view.tpl

{hook name="categories:view"}

{if $category_data.description || $runtime.customization_mode.live_editor}
<div class=“ty-wysiwyg-content ty-mb-s” {live_edit name=“category:description:{$category_data.category_id}”}>{$category_data.description nofilter}


{/if}

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


    {foreach from=$splitted_subcategories item=“ssubcateg”}
    {foreach from=$ssubcateg item=category name=“ssubcateg”}
    {if $category}

  • <a href=“{“categories.view?category_id=$category.category_id”|fn_url}”>
    {if $category.main_pair}
    {include file=“common/image.tpl”
    show_detailed_link=false
    images=$category.main_pair
    no_ids=true
    image_id=“category_image”
    image_width=$settings.Thumbnails.category_lists_thumbnail_width
    image_height=$settings.Thumbnails.category_lists_thumbnail_height
    class=“ty-subcategories-img”
    }
    {/if}
    <span {live_edit name=“category:category:{$category.category_id}”}>{$category.category}


  • {/if}
    {/foreach}
    {/foreach}

{/if}

{if $products}
{assign var=“layouts” value=“”|fn_get_products_views:false:0}
{if $category_data.product_columns}
{assign var=“product_columns” value=$category_data.product_columns}
{else}
{assign var=“product_columns” value=$settings.Appearance.columns_in_products_list}
{/if}

{if $layouts.$selected_layout.template}
{include file=“$layouts.$selected_layout.template” columns=$product_columns}
{/if}

{elseif !$subcategories || $show_no_products_block}

{__("text_no_products")}

{else}
{/if}

{capture name=“mainbox_title”}<span {live_edit name=“category:category:{$category_data.category_id}”}>{$category_data.category}{/capture}
{/hook}

p.s if there are many sub-categories I have to create many html page and link between them

category.PNG

catehory html.PNG

final.PNG

If I understand correctly, you are trying to create categories in the website pages? http://demo.cs-cart.com/admin.php?dispatch=pages.manage&get_tree=multi_level

If you're trying to create categories for products, you should be using the product categories. http://demo.cs-cart.com/admin.php?dispatch=categories.manage

No need to create a whole new page. You can get rid of the product list on category pages in Settings|General. Under Catalog uncheck "Show products from subcategories of the selected category". The left column with the filter block and recently viewed might automatically disappear when you do that but if not go into Design|Layout and click on the Categories tab. Deactivate the Grid 4 that contains the Filter and Recently Viewed blocks.

now I will try)