Jump to content

Category page


Recommended Posts

Hello, now on my site theres category and subcategory.
If i click on principal category it open a list of all item in the subcategory.

Now i want to create a page that, when i click on a category it doen't open the product list, but a new page with the list of the subcategory and their image and link.


How can i do that?

Link to comment
Share on other sites

Thanks, but i don't understand which code i must edit:

{include file=$tpl_dir./breadcrumb.tpl} 
{include file=$tpl_dir./errors.tpl}

{if $category->id AND $category->active}

       {$category->name|escape:'htmlall':'UTF-8'}
{$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if}


   {if $scenes}
       <!-- Scenes -->
       {include file=$tpl_dir./scenes.tpl scenes=$scenes}
   {else}
       <!-- Category image -->
       {if $category->id_image}
getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
       {/if}
   {/if}

   {if $category->description}
{$category->description}
   {/if}
   {if isset($subcategories)}
   {/if}

   {if $products}
           {include file=$tpl_dir./product-sort.tpl}
           {include file=$tpl_dir./product-list.tpl products=$products}
           {include file=$tpl_dir./pagination.tpl}
       {elseif !isset($subcategories)}

{l s='There is no product in this category.'}
       {/if}
{elseif $category->id}

{l s='This category is currently unavailable.'}
{/if}

Link to comment
Share on other sites

Hello,
why not copy the category page and its template, rename them using your category name and change line:

$category = new Category(intval(Tools::getValue('id_category')), intval($cookie->id_lang));


by

$category = new Category(intval(your_category_id), intval($cookie->id_lang));


in your php file?

Link to comment
Share on other sites

×
×
  • Create New...