productAttributeValues
function, since version 1.3.2
categories: product, prestashop
productAttributeValues(productId, attributeId)
Returns list of all attribute values that exists for given product. This is useful if you want to summarize product combinations. For example, you can export all existing product sizes or colors, in a single field.
parameters
- productId: number - product ID
- attributeId: number - attribute ID - id of attribute you want to summarize
return type:
array[string]
examples
productAttributeValues(product.id, 2); // [ S, M, XXL ]
productAttributeValues(product.id, 3); // [ Red, Blue, Black ]