Jump to content

[SOLVED] Hide product list from category


Recommended Posts

Hi,

 

I'm trying to do something similar to this: http://www.prestasho...-form-category/, but instead of wanting the links to the sub-categories, I want a page to load with images. The solution doesn't work for me, as I want the layered navigation module activated.

 

So basically, what I want to happen is that when you click on a Category, it will load a page with 3 images. The sub-categories will appear below the Category in the left as per usual. The images with direct to different parts of the store (depending on which they choose). I would like it so that the product list doesn't load at all.

 

But when I took the product list part out of the code in category.tpl:

 

<li id="productsSortForm">
			{if $products}
				{include file="$tpl_dir./product-sort.tpl"}
				{include file="$tpl_dir./product-compare.tpl"}
			{/if}
		</li>
{include file="$tpl_dir./product-list.tpl" products=$products}
			{if $products}
				{include file="$tpl_dir./pagination.tpl"}
			{/if}

 

It would work, but like the other poster said, it would take the product list from ALL pages (including the sub-categories').

 

Is there a way to add a statement or edit so that if the Category page is loading, to hide the product list, pagination, sort and compare. But if it is a Sub-Category page, to load all of that?

 

Thanks in advance!

  • Like 1
Link to comment
Share on other sites

Figured it out! This is for anyone who is trying to figure out how to do the same thing:

 

 

In categories.tpl, below:

 

{if $products}

 

add:

 

{if $category->id == '#'}

add conditional content here that you want to only appear in specified category

{else}


{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./product-sort.tpl"}
{include file="$tpl_dir./product-list.tpl" products=$products}
{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}

{/if}

 

where # is the category ID number.

Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...