Jump to content

Add a div / section in product page based on the product's category


justine123
 Share

Recommended Posts

Hi,

I'm fairly new to prestashop and we'd like to add a small section in the product detail page depending on the product's category.

How can I do that? Is there a variable I can use in the product.tpl?

I'd appreciate any help, thank you very much :)

Share this post


Link to post
Share on other sites

Hi,

You  can  use  a  condition  based  on  category id  like  this:


{if $product.id_category_default==3}
<div  class="your_class"   id="my_id">  
  here  div  content
</div>
{/if}

 

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
 Share

×
×
  • Create New...

Important Information

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