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

Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...
  • 3 weeks later...
  • 3 years later...

Hi guys,

I'll stick to it.

For example, how can I integrate the following condition in version 1.7.8 on a Productcategorie-Page:

If category ID =2 then output <p>Hello</p>

alternatively with several categories

If category ID =2,3,4,5 then output <p>Hello</p>


I've tried all of the above examples. 🤔

Link to comment
Share on other sites

You really should study more the extension system between the template parts.

For example you have

catalog/listing/category.tpl

which extends

catalog/listing/product-list.tpl

You have to add a block like this

{block name='right_column'}{/block}

But with a UNIQUE name e.g.

{block name='greek_mod'}{/block}

Then you call it in category.tpl and make the respective alteration.

NOT tested, but it should work. Always backup 😎

Edited by Kogkalidis (see edit history)
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...