Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How To Hide Products From Subcategory And Display Only The Last Rate Topic   - - - - -

 
  • sergey841
  • Newbie
  • Trial users
  • Join Date: 22-Jun 16
  • 2 posts

Posted 22 June 2016 - 06:43 AM #1

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

WBCnYPm.png

_damicom.md/compresoare-motocompresoare-kaeser-us

2. Create html page

ZeaTxnV.png
it turns out
EXmjJ8u.png
_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:

<div class="ty-mainbox-container clearfix">
	<div class="ty-mainbox-body">
		<div class="subcategories clearfix">
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-cu-urub-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Compresoare-cu-surub.jpg" alt="Compresoare cu șurub"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-cu-urub-kaeser" class="corner">Compresoare cu șurub</a>
				</div>
			</div>
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-mobile-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Compresoare-mobile.jpg" alt="Compresoare mobile"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-mobile-kaeser" class="corner">Compresoare mobile</a>
				</div>
			</div>
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-cu-piston-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Compresoare-cu-piston.jpg" alt="Compresoare cu piston"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-cu-piston-kaeser" class="corner">Compresoare cu piston</a>
				</div>
			</div>
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-dentare-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Compresoare-dentare.jpg" alt="Compresoare dentare"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/compresoare-dentare-kaeser" class="corner">Compresoare dentare</a>
				</div>
			</div>
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/pompe-de-vacuum-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Compresoare-cu-vacuum.jpg" alt="Pompe de vacuum"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/pompe-de-vacuum-kaeser" class="corner">Pompe de vacuum</a>
				</div>
			</div>
			<div class="ty-subcategories__item">
				<div class="visual">
					<div class="categorii">
						<a href="/compresoare-motocompresoare-industriale-kaeser/suflante-kaeser">
						<span class="inner-border" data-redactor-class="inner-border">
						<span class="border-builder"></span>
						<img src="/images/categorii/Kaeser---Suflante.jpg" alt="Suflante"></span>
						</a>
					</div>
					<a href="/compresoare-motocompresoare-industriale-kaeser/suflante-kaeser" class="corner">Suflante</a>
				</div>
			</div>
		</div>
	</div>
</div> 

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

{hook name="categories:view"}
<div id="category_products_{$block.block_id}">

{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}</div>
{/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"}
    <ul class="subcategories clearfix">
    {foreach from=$splitted_subcategories item="ssubcateg"}
        {foreach from=$ssubcateg item=category name="ssubcateg"}
            {if $category}
                <li class="ty-subcategories__item">
                    <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}</span>
                    </a>
                </li>
            {/if}
        {/foreach}
    {/foreach}
    </ul>
{/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}
<p class="ty-no-items cm-pagination-container">{__("text_no_products")}</p>
{else}
<div class="cm-pagination-container"></div>
{/if}
<!--category_products_{$block.block_id}--></div>

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

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

 

 

Attached Files



 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3868 posts

Posted 22 June 2016 - 03:29 PM #2

If I understand correctly, you are trying to create categories in the website pages? http://demo.cs-cart....ree=multi_level

 

If you're trying to create categories for products, you should be using the product categories.  http://demo.cs-cart....tegories.manage



 
  • straygecko
  • Advanced Member
  • Members
  • Join Date: 01-May 13
  • 93 posts

Posted 22 June 2016 - 08:40 PM #3

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.



 
  • sergey841
  • Newbie
  • Trial users
  • Join Date: 22-Jun 16
  • 2 posts

Posted 23 June 2016 - 05:44 AM #4

now I will try)