@plentymarkets/shop-api / productAttributeGetters
Variable: productAttributeGetters ​
constproductAttributeGetters:object
Defined in: getters/productAttributeGetters.ts:139
Type Declaration ​
getAttributeId ​
getAttributeId: (
attribute) =>number
Returns the numeric ID of an attribute.
Parameters ​
attribute ​
The variation map product attribute.
Returns ​
number
The attribute ID.
getAttributeName ​
getAttributeName: (
attribute) =>string
Returns the display name of an attribute.
Parameters ​
attribute ​
The variation map product attribute.
Returns ​
string
The attribute name string.
getAttributes ​
getAttributes: (
product) =>VariationMapProductAttribute[]
Returns the sorted list of variation attributes for the product. Attributes are sorted by position first, then alphabetically by name.
Parameters ​
product ​
The product object.
Returns ​
VariationMapProductAttribute[]
An array of VariationMapProductAttribute objects, or an empty array if none exist.
getAttributeType ​
getAttributeType: (
attribute) =>string
Returns the display type of an attribute (e.g. "select", "image", "color").
Parameters ​
attribute ​
The variation map product attribute.
Returns ​
string
The type string.
getAttributeValueById ​
getAttributeValueById: (
attribute,valueId) =>VariationMapProductAttributeValue|undefined
Finds an attribute value by its numeric ID within an attribute's values list.
Parameters ​
attribute ​
The variation map product attribute.
valueId ​
number
The numeric ID of the attribute value to find.
Returns ​
VariationMapProductAttributeValue | undefined
The matching VariationMapProductAttributeValue, or undefined if not found.
getAttributeValueId ​
getAttributeValueId: (
value) =>number
Returns the numeric ID of an attribute value.
Parameters ​
value ​
VariationMapProductAttributeValue
The variation map product attribute value.
Returns ​
number
The attribute value ID.
getAttributeValueImageUrl ​
getAttributeValueImageUrl: (
value) =>string
Returns the image URL for an attribute value (used when the attribute type is "image").
Parameters ​
value ​
VariationMapProductAttributeValue
The variation map product attribute value.
Returns ​
string
The image URL string.
getAttributeValueName ​
getAttributeValueName: (
value) =>string
Returns the display name of an attribute value.
Parameters ​
value ​
VariationMapProductAttributeValue
The variation map product attribute value.
Returns ​
string
The attribute value name string.
getAttributeValues ​
getAttributeValues: (
attribute) =>VariationMapProductAttributeValue[]
Returns the sorted list of values for an attribute. Values are sorted by position, then by attribute value ID, then alphabetically by name.
Parameters ​
attribute ​
The variation map product attribute.
Returns ​
VariationMapProductAttributeValue[]
A sorted array of VariationMapProductAttributeValue objects.
isAttributeValueDisabled ​
isAttributeValueDisabled: (
value) =>boolean
Returns whether the attribute value is disabled for selection.
Parameters ​
value ​
VariationMapProductAttributeValue
The variation map product attribute value.
Returns ​
boolean
true if the value is disabled, otherwise false.