@plentymarkets/shop-api / productPropertyGetters
Variable: productPropertyGetters ​
constproductPropertyGetters:object
Defined in: getters/productPropertyGetters.ts:648
Type Declaration ​
getGroup ​
getGroup: (
id,propertyGroups) =>VariationPropertyGroup|null
Finds the variation property group with the given ID.
Parameters ​
id ​
number
The numeric ID of the group to find.
propertyGroups ​
The array of variation property groups.
Returns ​
VariationPropertyGroup | null
The matching VariationPropertyGroup, or null if not found.
getGroupDescription ​
getGroupDescription: (
propertyGroup) =>string
Returns the description of a variation property group.
Parameters ​
propertyGroup ​
The variation property group.
Returns ​
string
The group description string, or an empty string if not set.
getGroupId ​
getGroupId: (
propertyGroup) =>number
Returns the group ID of a variation property (the ID of its parent group).
Parameters ​
propertyGroup ​
The variation property (despite its name, accesses groupId).
Returns ​
number
The group ID.
getGroupName ​
getGroupName: (
propertyGroup) =>string
Returns the display name of a variation property group.
Parameters ​
propertyGroup ​
The variation property group.
Returns ​
string
The group name string, or an empty string if not set.
getOrderPropertiesGroups ​
getOrderPropertiesGroups: (
product) =>OrderPropertiesGroups
Groups the order properties of a product by their group ID and returns them sorted by position. Properties without a group are placed in group 0.
Parameters ​
product ​
The product object.
Returns ​
A sorted OrderPropertiesGroups object keyed by group ID.
getOrderPropertyDescription ​
getOrderPropertyDescription: (
property) =>string
Returns the description of an order property.
Parameters ​
property ​
The product property object.
Returns ​
string
The description string, or an empty string if not set.
getOrderPropertyGroupDescription ​
getOrderPropertyGroupDescription: (
propertyGroup) =>string
Returns the description of an order property group.
Parameters ​
propertyGroup ​
The order properties group object.
Returns ​
string
The group description string.
getOrderPropertyGroupName ​
getOrderPropertyGroupName: (
propertyGroup) =>string
Returns the display name of an order property group.
Parameters ​
propertyGroup ​
The order properties group object.
Returns ​
string
The group name string.
getOrderPropertyId ​
getOrderPropertyId: (
property) =>number
Returns the numeric ID of an order property's inner property definition.
Parameters ​
property ​
The product property object.
Returns ​
number
The property ID.
getOrderPropertyLabel ​
getOrderPropertyLabel: (
property) =>OrderPropertyLabel
Computes the surcharge label metadata for an order property. Determines the surcharge type ("plus" or "incl"), the surcharge indicator ("*"), and the required indicator ("**").
Parameters ​
property ​
The product property object.
Returns ​
An OrderPropertyLabel object containing surchargeType, surchargeIndicator, and requiredIndicator.
getOrderPropertyName ​
getOrderPropertyName: (
property) =>string
Returns the display name of an order property.
Parameters ​
property ​
The product property object.
Returns ​
string
The property name string, or an empty string if not set.
getOrderPropertySurcharge ​
getOrderPropertySurcharge: (
property) =>number
Returns the surcharge amount for an order property. Uses the property-level surcharge first, falling back to the inner property surcharge.
Parameters ​
property ​
The product property object.
Returns ​
number
The surcharge amount as a number.
getOrderPropertyValueType ​
getOrderPropertyValueType: (
property) =>string
Returns the value type of an order property (e.g. "text", "int", "selection", "file", "empty").
Parameters ​
property ​
The product property object.
Returns ​
string
The value type string.
getProductProperty ​
getProductProperty: (
id,productProperties) =>ProductProperty|null
Finds a product property by its numeric ID in the given properties list.
Parameters ​
id ​
number
The numeric ID of the property to find.
productProperties ​
The array of product properties to search.
Returns ​
ProductProperty | null
The matching ProductProperty, or null if not found.
getProperties ​
getProperties: (
propertyGroup) =>VariationProperty[]
Returns all properties belonging to a variation property group.
Parameters ​
propertyGroup ​
The variation property group.
Returns ​
An array of VariationProperty objects.
getProperty ​
getProperty: (
id,propertyGroups) =>VariationProperty|null
Finds the first property with the given ID across all property groups.
Parameters ​
id ​
number
The numeric ID of the property to find.
propertyGroups ​
The array of variation property groups.
Returns ​
VariationProperty | null
The matching VariationProperty, or null if not found.
getPropertyCast ​
getPropertyCast: (
property) =>string
Returns the cast type of a variation property (e.g. "text", "html", "file").
Parameters ​
property ​
The variation property.
Returns ​
string
The cast type string.
getPropertyDownloadLink ​
getPropertyDownloadLink: (
property) =>string
Returns the download link URL for a file-type variation property.
Parameters ​
property ​
The variation property.
Returns ​
string
The download link URL string, or an empty string if not set.
getPropertyFromGroup ​
getPropertyFromGroup: (
id,propertyGroup) =>VariationProperty|null
Finds the property with the given ID within a single property group.
Parameters ​
id ​
number
The numeric ID of the property to find.
propertyGroup ​
The variation property group to search within.
Returns ​
VariationProperty | null
The matching VariationProperty, or null if not found.
getPropertyId ​
getPropertyId: (
property) =>number
Returns the numeric ID of a variation property.
Parameters ​
property ​
The variation property.
Returns ​
number
The property ID.
getPropertyName ​
getPropertyName: (
property) =>string
Returns the display name of a variation property.
Parameters ​
property ​
The variation property.
Returns ​
string
The property name string, or an empty string if not set.
getPropertyNameDescription ​
getPropertyNameDescription: (
property) =>string
Returns the description of a variation property's name entry.
Parameters ​
property ​
The variation property.
Returns ​
string
The name description string, or an empty string if not set.
getPropertyValue ​
getPropertyValue: (
property) =>string
Returns the string value of a variation property.
Parameters ​
property ​
The variation property.
Returns ​
string
The property value string.
getPropertyValueDescription ​
getPropertyValueDescription: (
property) =>string
Returns the description of a variation property's value entry.
Parameters ​
property ​
The variation property.
Returns ​
string
The value description string.
getPropertyValueId ​
getPropertyValueId: (
property) =>number
Returns the numeric ID of the selected property value.
Parameters ​
property ​
The variation property.
Returns ​
number
The value ID, or -1 if not set.
groupsHasRequiredOrderProperties ​
groupsHasRequiredOrderProperties: (
groups) =>boolean
Returns whether any group in the order properties groups contains a required order property.
Parameters ​
groups ​
The order properties groups object.
Returns ​
boolean
true if at least one group contains a required order property, otherwise false.
hasGroup ​
hasGroup: (
id,propertyGroups) =>boolean
Returns whether a group with the given ID exists in the property groups.
Parameters ​
id ​
number
The numeric ID of the group to check.
propertyGroups ​
The array of variation property groups.
Returns ​
boolean
true if the group exists, otherwise false.
hasOrderProperties ​
hasOrderProperties: (
product) =>boolean
Returns whether the product has any order properties.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the product has order properties, otherwise false.
hasOrderPropertiesGroupsTooltips ​
hasOrderPropertiesGroupsTooltips: (
orderPropertiesGroups) =>boolean
Returns whether any group in the order properties groups has a tooltip (property description).
Parameters ​
orderPropertiesGroups ​
The full order properties groups object.
Returns ​
boolean
true if at least one group has a property with a description, otherwise false.
hasOrderPropertyDescription ​
hasOrderPropertyDescription: (
property) =>boolean
Returns whether an order property has a non-empty description.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property has a description, otherwise false.
hasProperty ​
hasProperty: (
id,propertyGroups) =>boolean
Returns whether a property with the given ID exists in the property groups.
Parameters ​
id ​
number
The numeric ID of the property to check.
propertyGroups ​
The array of variation property groups.
Returns ​
boolean
true if the property exists, otherwise false.
hasPropertyVat ​
hasPropertyVat: (
forOrderProperty,property) =>boolean
Returns whether the property has a VAT ID assigned (optionally restricted to order properties only).
Parameters ​
forOrderProperty ​
boolean
When true, only considers order properties.
property ​
The product property object.
Returns ​
boolean
true if a VAT ID is set (and the order property condition is satisfied), otherwise false.
isHTML ​
isHTML: (
property) =>boolean
Returns whether the property cast type is "html".
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the cast is HTML, otherwise false.
isImage ​
isImage: (
property) =>boolean
Returns whether the property value is an image file (JPEG or WebP).
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the property value is a JPEG or WebP image, otherwise false.
isJpegFile ​
isJpegFile: (
property) =>boolean
Returns whether the property value is a JPEG image file.
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the cast is "file" and the extension is .jpg or .jpeg, otherwise false.
isMP4File ​
isMP4File: (
property) =>boolean
Returns whether the property value is an MP4 video file.
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the cast is "file" and the extension is .mp4, otherwise false.
isMultiline ​
isMultiline: (
property) =>boolean
Returns whether the order property uses multiline text input.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property is multiline, otherwise false.
isOrderProperty ​
isOrderProperty: (
property) =>boolean
Returns whether the product property is an order property.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property is marked as an order property, otherwise false.
isOrderPropertyCheckbox ​
isOrderPropertyCheckbox: (
property) =>boolean
Returns whether the order property is a checkbox (value type "empty").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property value type is "empty", otherwise false.
isOrderPropertyFile ​
isOrderPropertyFile: (
property) =>boolean
Returns whether the order property accepts a file upload (value type "file").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the value type is "file", otherwise false.
isOrderPropertyFloat ​
isOrderPropertyFloat: (
property) =>boolean
Returns whether the order property accepts decimal/float input (value type "float").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the value type is "float", otherwise false.
isOrderPropertyHidden ​
isOrderPropertyHidden: (
property) =>boolean
Returns whether the order property should be hidden in the UI. A property is hidden when it is both required and pre-selected.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property is required and pre-selected (i.e. should be hidden), otherwise false.
isOrderPropertyInput ​
isOrderPropertyInput: (
property) =>boolean
Returns whether the order property accepts text-like input (text, integer, or float).
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property accepts text, integer, or float input, otherwise false.
isOrderPropertyInt ​
isOrderPropertyInt: (
property) =>boolean
Returns whether the order property accepts integer input (value type "int").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the value type is "int", otherwise false.
isOrderPropertyPreSelected ​
isOrderPropertyPreSelected: (
property) =>boolean
Returns whether the order property is pre-selected by default.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property is pre-selected, otherwise false.
isOrderPropertyRequired ​
isOrderPropertyRequired: (
property) =>boolean
Returns whether the order property is required.
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the property must be filled in by the customer, otherwise false.
isOrderPropertySelection ​
isOrderPropertySelection: (
property) =>boolean
Returns whether the order property is a dropdown/selection (value type "selection").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the value type is "selection", otherwise false.
isOrderPropertyText ​
isOrderPropertyText: (
property) =>boolean
Returns whether the order property accepts free-text input (value type "text").
Parameters ​
property ​
The product property object.
Returns ​
boolean
true if the value type is "text", otherwise false.
isPropertyShownAsAdditionalCosts ​
isPropertyShownAsAdditionalCosts: (
forOrderProperty,property) =>boolean
Returns whether the property is configured to be shown as an additional cost line. Optionally restricts the check to order properties only.
Parameters ​
forOrderProperty ​
boolean
When true, only considers order properties.
property ​
The product property object.
Returns ​
boolean
true if the property should be shown as additional costs, otherwise false.
isText ​
isText: (
property) =>boolean
Returns whether the property cast type is "text".
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the cast is plain text, otherwise false.
isWebpFile ​
isWebpFile: (
property) =>boolean
Returns whether the property value is a WebP image file.
Parameters ​
property ​
The variation property.
Returns ​
boolean
true if the cast is "file" and the extension is .webp, otherwise false.