Jump to content

Get Product Category


cipraen

Recommended Posts

Hi,

 

I want to exclude products from a category XYZ from being displayed.

 

In products-list.tpl file after this line

{foreach from=$products item=product name=products}

I want to add an IF clause that checks the products againts their category and if they are not in category XYZ then they get displayed.

 

I'm new to prestashop so how to you get the product category in smarty ?

Link to comment
Share on other sites

Hi,

 

I want to exclude products from a category XYZ from being displayed.

 

In products-list.tpl file after this line

{foreach from=$products item=product name=products}

I want to add an IF clause that checks the products againts their category and if they are not in category XYZ then they get displayed.

 

I'm new to prestashop so how to you get the product category in smarty ?

 

 

are your products associated with several categories ? i mean, is one product associated with more than one category?

Link to comment
Share on other sites

are your products associated with several categories ? i mean, is one product associated with more than one category?

 

Yes. I have products (lunch A, lunch B, etc.).

All lunch products are in the Lunch Category.

Some lunch products are in Week 1 Category some are in Week 2 Category.

 

I can hide the Week Category that is not supposed to be active, but in the Lunch Category products from both Week Categories are still shown.

 

This is what I'm trying to achieve. To exclude the products from a certain Category from being shown in the common category.

Link to comment
Share on other sites

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...