Jump to content

{if $category->id == "25" } for 1.7 doesn't work


Recommended Posts

Hello,
 
On prestashop 1.6, i used this code to show an image or another thing only in a specific category.

{if $category->id == "25" }

But, with Prestashop 1.7, i don't found the code to use.

 

Anyone to help me.. I know, i'm a noob! :-)

(and sorry for my english)

 

Thanks a lot !

 

Clément

Share this post


Link to post
Share on other sites
  • 7 months later...
  • 1 year later...
On 1/22/2018 at 1:33 PM, Rus_3ds said:

This is work for Prestashop 1.7

 {if $category.id == 3} {  some action }    {/if}

Bro, you're code is wrong. I'm looking for the right one.

 

EDIT

{if $category->id == 3}  

  Some action 

{/if}

 

Edited by Sasha Chirico
Right code (see edit history)

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Guys both can be right or wrong.

If we talk about children categories in a category controller, category.id is proper.

If we talk about the category itself, category->id is proper.

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More