Tamade Posted March 26, 2021 Share Posted March 26, 2021 Hello. To refer to a specific product, we use its id, "id_product", to be able to use the value of its attribute, how should I do? for example: A pen has the color attribute with red and blue values. I want it to look at the attribute value, and if it is red, to display some text. How do I reference the attribute value? Thanks prestashop v1.7.7.1 classic Link to comment Share on other sites More sharing options...
musicmaster Posted March 27, 2021 Share Posted March 27, 2021 You have two id's that are interesting: id_attribute refers to just to the attribute, like color red. id_product_attribute refers to a variant of the product, like a red pen. My impression is that you are looking for the latter. 1 Link to comment Share on other sites More sharing options...
Tamade Posted April 28, 2021 Author Share Posted April 28, 2021 (edited) On 3/27/2021 at 12:01 PM, musicmaster said: You have two id's that are interesting: id_attribute refers to just to the attribute, like color red. id_product_attribute refers to a variant of the product, like a red pen. My impression is that you are looking for the latter. Hello I have a product with attributes and with a discount, how should I do so that if a product has attributes, the price without discount is not displayed? The price without discount is {$ product.regular_price}, but how do I indicate if the product has attributes. I have tried doing {if !empty ($ group.attributes)}, but it doesn't work. Any ideas? Thanks Edited April 28, 2021 by Tamade (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted April 28, 2021 Share Posted April 28, 2021 1 hour ago, Tamade said: Hello I have a product with attributes and with a discount, how should I do so that if a product has attributes, the price without discount is not displayed? The price without discount is {$ product.regular_price}, but how do I indicate if the product has attributes. I have tried doing {if !empty ($ group.attributes)}, but it doesn't work. Any ideas? Thanks I have no idea. Maybe someone else... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now