I am working with PRESTASHOP 1.7, I have created several attributes for the products, the fact is that, if the product being viewed has a specific attribute, I want to display a specific HTML code, and I need it to be in TPL.
My problem is that I don't know how to access the attributes of a product, I need a condition to be able to check that if the value of an attribute is such, the HTML code inside the condition is displayed.
I have seen on the internet that using something similar to this: '$product.id_product_attribute == 0 or >0'
But I don't think it works for me, I think that code only indicates if the product has attributes or not, I need to know if a product has a specific attribute and know its value.
I'm new to PRESTASHOP and TPLs, so I don't really know how all this really works.
This is the little I have, in the if is where the condition would have to go to check if the product has said attribute or not, and if so, check its value.
{if $product.}
<div class="">
</div>
{/if}
Any ideas?
Thank you very much and greetings.
you can try this:
or also
Inside the if you can make
{$product.attributes|var_dump}
and see the variables and the data that you may be interested in using.