Jump to content

The attribute value of a product. (v1.7.7.1)


Tamade

Recommended Posts

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

  • 1 month later...
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 by Tamade (see edit history)
Link to comment
Share on other sites

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

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...