@plentymarkets/shop-api / productGetters
Variable: productGetters ​
constproductGetters:object
Defined in: getters/productGetters.ts:869
Type Declaration ​
canBeAddedToCartFromCategoryPage ​
canBeAddedToCartFromCategoryPage: (
product) =>boolean
Determines whether the product can be added directly to the cart from a category page. Returns false if the product is not salable, has required order properties, is a set item, has a minimum order quantity other than 1, has an interval order quantity greater than 1, has multiple salable variations, or has graduated prices.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the product can be added to cart from the category page.
getAgenciesAvailabilityCLass ​
getAgenciesAvailabilityCLass: (
product) =>string
Returns a CSS class name derived from the variation's availability ID (e.g. "availability-1").
Parameters ​
product ​
The product object.
Returns ​
string
The CSS class name string.
getAttributeMapVariations ​
getAttributeMapVariations: (
product) =>VariationMapProductVariation[]
Returns all variations from the product's variation attribute map.
Parameters ​
product ​
The product object.
Returns ​
VariationMapProductVariation[]
An array of VariationMapProductVariation objects, or an empty array.
getAttributes ​
getAttributes: (
products) =>ProductAttributeValue[][][]
Returns a three-dimensional array of attribute values for each product. The structure is [product][attribute][attributeValue].
Parameters ​
products ​
Product[]
An array of product objects.
Returns ​
ProductAttributeValue[][][]
A nested array of ProductAttributeValue objects.
getAvailabilityAverageDays ​
getAvailabilityAverageDays: (
product) =>number
Returns the average number of days for the variation's availability (e.g. delivery time).
Parameters ​
product ​
The product object.
Returns ​
number
The average days as a number.
getAvailabilityBackgroundColor ​
getAvailabilityBackgroundColor: (
product) =>string
Returns the background color associated with the variation's availability state.
Parameters ​
product ​
The product object.
Returns ​
string
The background color value from AvailabilityBackgroundColor.
getAvailabilityId ​
getAvailabilityId: (
product) =>number
Returns the availability ID for the product variation (1–10).
Parameters ​
product ​
The product object.
Returns ​
number
The numeric availability ID.
getAvailabilityName ​
getAvailabilityName: (
product) =>string
Returns the display name of the variation's availability state.
Parameters ​
product ​
The product object.
Returns ​
string
The availability name string.
getAvailabilityTextColor ​
getAvailabilityTextColor: (
product) =>string
Returns the text color associated with the variation's availability state.
Parameters ​
product ​
The product object.
Returns ​
string
The text color value from AvailabilityTextColor.
getAverageRating ​
getAverageRating: (
product,roundOption?) =>number
Returns the average customer rating of the product.
Parameters ​
product ​
The product object.
roundOption? ​
"half" | "tenth"
Optional rounding strategy: 'half' rounds to the nearest 0.5, 'tenth' rounds to the nearest 0.1.
Returns ​
number
The average rating as a number, or 0 if not set.
getBarcodes ​
getBarcodes: (
product) =>Barcode[]
Returns the list of barcodes associated with the product.
Parameters ​
product ​
The product object.
Returns ​
Barcode[]
An array of Barcode objects, or an empty array.
getCategoryId ​
getCategoryId: (
product) =>number
Returns the numeric ID of the product's first default category.
Parameters ​
product ​
The product object.
Returns ​
number
The category ID, or 0 if not set.
getCategoryIds ​
getCategoryIds: (
product) =>string[]
Returns an array of category IDs for all of the product's default categories.
Parameters ​
product ​
The product object.
Returns ​
string[]
An array of category ID strings, or [''] if no categories are assigned.
getCategoryName ​
getCategoryName: (
product) =>string
Returns the name of the product's primary default category.
Parameters ​
product ​
The product object.
Returns ​
string
The category name, or an empty string if no default category is assigned.
getCategoryUrlPath ​
getCategoryUrlPath: (
product,categories) =>string
Returns the URL path for the product's primary default category.
Parameters ​
product ​
The product object.
categories ​
The full category tree.
Returns ​
string
The category URL path, or an empty string if the category is not found.
getCheapestGraduatedPrice ​
getCheapestGraduatedPrice: (
product) =>number=productPriceGetters.getCheapestGraduatedPrice
Returns the cheapest graduated unit price for the product. Finds the tier with the lowest unit price among all graduated price tiers.
Parameters ​
product ​
The product object.
Returns ​
number
The cheapest graduated unit price value, or 0 if no graduated prices exist.
getCoverImage ​
getCoverImage: (
product) =>string
Returns the normal-size URL of the product's primary cover image.
Parameters ​
product ​
The product object.
Returns ​
string
The cover image URL, or an empty string if not available.
getCoverImagePreview ​
getCoverImagePreview: (
product) =>string
Returns the small-size preview URL of the product's primary cover image.
Parameters ​
product ​
The product object.
Returns ​
string
The cover image preview URL, or an empty string if not available.
getCrossedPrice ​
getCrossedPrice: (
product) =>number|null=productPriceGetters.getCrossedPrice
Returns the recommended retail price (RRP / crossed-out price) of the product.
Parameters ​
product ​
The product object.
Returns ​
number | null
The RRP unit price as a number, or null if not set.
getDefaultBasePrice ​
getDefaultBasePrice: (
product) =>string=productPriceGetters.getDefaultBasePrice
Returns the base price string from the product's default price tier (e.g. "1,99 € / 100 ml").
Parameters ​
product ​
The product object.
Returns ​
string
The base price string, or undefined if not set.
getDefaultBaseSinglePrice ​
getDefaultBaseSinglePrice: (
product) =>number=productPriceGetters.getDefaultBaseSinglePrice
Returns the base single price from the product's default price tier.
Parameters ​
product ​
The product object.
Returns ​
number
The base single price, or -1 if not set.
getDescription ​
getDescription: (
product) =>string
Returns the full HTML description of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The product description, or an empty string if not set.
getFirstImage ​
getFirstImage: (
product) =>AgnosticImage
Returns the first product image as an AgnosticImage with a URL and alt text. Prefers variation-specific images; falls back to all item images.
Parameters ​
product ​
The product object.
Returns ​
AgnosticImage
An AgnosticImage containing the medium-size URL and a clean image name as alt text.
getFullImage ​
getFullImage: (
product) =>string
Returns the full-size image URL, preferring a variation-specific image over the general item image.
Parameters ​
product ​
The product object.
Returns ​
string
The full-size image URL, or an empty string if not available.
getGallery ​
getGallery: (
product) => [] |ImagesData[]
Returns the image gallery for the product. Prefers variation-specific images; falls back to all item images.
Parameters ​
product ​
The product object.
Returns ​
[] | ImagesData[]
An array of image data objects, or an empty array if the product is not defined.
getGraduatedList ​
getGraduatedList: (
product) =>GraduatedPriceList[] =productPriceGetters.getGraduatedList
Returns a list of graduated price tiers for display, excluding the first (base) tier. Each entry includes the price, minimum quantity, and discount percentage relative to the base price.
Parameters ​
product ​
The product object.
Returns ​
An array of GraduatedPriceList objects for all tiers with a minimum quantity greater than 1.
getGraduatedPriceByQuantity ​
getGraduatedPriceByQuantity: (
product,quantity) =>Default|null=productPriceGetters.getGraduatedPriceByQuantity
Returns the graduated price tier that applies for the given order quantity. Iterates through the sorted graduated prices and returns the last one whose minimum order quantity is less than or equal to quantity.
Parameters ​
product ​
The product object.
quantity ​
number
The order quantity to check against.
Returns ​
Default | null
The applicable Default graduated price, or null if none matches.
getGraduatedPrices ​
getGraduatedPrices: (
product) =>Default[] =productPriceGetters.getGraduatedPrices
Returns the graduated prices for the product, sorted by minimum order quantity ascending.
Parameters ​
product ​
The product object.
Returns ​
Default[]
A sorted array of Default graduated price objects.
getGroupedAttributes ​
getGroupedAttributes: (
product) =>ProductGroupedAttribute[]
Returns the grouped attributes for the product (e.g. color and size combined).
Parameters ​
product ​
The product object.
Returns ​
An array of ProductGroupedAttribute objects, or an empty array.
getGroupedAttributesString ​
getGroupedAttributesString: (
product) =>string
Returns a formatted string of all grouped attributes in ", name: value" format. Returns an empty string if the product has no grouped attributes.
Parameters ​
product ​
The product object.
Returns ​
string
A concatenated attribute string prefixed with ", ", or an empty string.
getHeightMM ​
getHeightMM: (
product) =>number
Returns the height of the product variation in millimeters.
Parameters ​
product ​
The product object.
Returns ​
number
The height in mm, or 0 if not set.
getId ​
getId: (
product) =>string
Returns the variation ID as a string.
Parameters ​
product ​
The product object.
Returns ​
string
The variation ID string, or an empty string if not set.
getImageHeight ​
getImageHeight: (
product) =>number
Returns the height of the first gallery image in pixels.
Parameters ​
product ​
The product object.
Returns ​
number
The image height, or 0 if not set.
getImageWidth ​
getImageWidth: (
product) =>number
Returns the width of the first gallery image in pixels.
Parameters ​
product ​
The product object.
Returns ​
number
The image width, or 0 if not set.
getItemId ​
getItemId: (
product) =>string
Returns the item ID (parent product ID) as a string.
Parameters ​
product ​
The product object.
Returns ​
string
The item ID string, or an empty string if not set.
getLengthMM ​
getLengthMM: (
product) =>number
Returns the length of the product variation in millimeters.
Parameters ​
product ​
The product object.
Returns ​
number
The length in mm, or 0 if not set.
getLowestPrice ​
getLowestPrice: (
product) =>number|null=productPriceGetters.getLowestPrice
Returns the lowest price of the product (used for 30-day lowest price compliance).
Parameters ​
product ​
The product object.
Returns ​
number | null
The lowest price value, or null if not set.
getManufacturer ​
getManufacturer: (
product) =>Manufacturer
Returns the manufacturer of the product. When the manufacturer data is an array, the first entry is returned.
Parameters ​
product ​
The product object.
Returns ​
The Manufacturer object.
getMaxRating ​
getMaxRating: (
product) =>number
Returns the maximum possible rating value.
Parameters ​
product ​
The product object (currently unused).
Returns ​
number
Always returns 5.
getMetaDescription ​
getMetaDescription: (
product) =>string
Returns the meta description of the product for SEO purposes.
Parameters ​
product ​
The product object.
Returns ​
string
The meta description string, or an empty string if not set.
getMetaKeywords ​
getMetaKeywords: (
product) =>string
Returns the meta keywords of the product for SEO purposes.
Parameters ​
product ​
The product object.
Returns ​
string
The keywords string, or an empty string if not set.
getMiddleImage ​
getMiddleImage: (
product) =>string
Returns the medium-size image URL, preferring a variation-specific image over the general item image.
Parameters ​
product ​
The product object.
Returns ​
string
The medium-size image URL, or an empty string if not available.
getMinimumOrderQuantity ​
getMinimumOrderQuantity: (
product) =>number
Returns the minimum order quantity for the product variation.
Parameters ​
product ​
The product object.
Returns ​
number
The minimum order quantity, defaulting to 1.
getName ​
getName: (
product) =>string
Returns the primary name (name1) of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The primary product name, or an empty string if not set.
getName2 ​
getName2: (
product) =>string
Returns the secondary name (name2) of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The secondary product name, or an empty string if not set.
getName3 ​
getName3: (
product) =>string
Returns the tertiary name (name3) of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The tertiary product name, or an empty string if not set.
getParentCategoryId ​
getParentCategoryId: (
product) =>number
Returns the parent category ID of the product's first default category.
Parameters ​
product ​
The product object.
Returns ​
number
The parent category ID, or 0 if not set.
getPreviewImage ​
getPreviewImage: (
product) =>string
Returns the preview image URL, preferring a variation-specific image over the general item image.
Parameters ​
product ​
The product object.
Returns ​
string
The preview image URL, or an empty string if not available.
getPrice ​
getPrice: (
product) =>number|null=productPriceGetters.getPrice
Returns the default unit price of the product.
Parameters ​
product ​
The product object.
Returns ​
number | null
The unit price as a number, or null if not set.
getPropertyById ​
getPropertyById: (
id,product) =>VariationProperty
Returns the variation property with the given ID.
Parameters ​
id ​
number
The numeric ID of the property.
product ​
The product object.
Returns ​
The matching VariationProperty.
getPropertyGroupById ​
getPropertyGroupById: (
id,product) =>VariationPropertyGroup
Returns the variation property group with the given ID.
Parameters ​
id ​
number
The numeric ID of the property group.
product ​
The product object.
Returns ​
The matching VariationPropertyGroup.
getPropertyGroups ​
getPropertyGroups: (
product) =>VariationPropertyGroup[]
Returns all variation property groups for the product.
Parameters ​
product ​
The product object.
Returns ​
An array of VariationPropertyGroup objects, or an empty array.
getRegularPriceCurrency ​
getRegularPriceCurrency: (
product) =>string=productPriceGetters.getRegularPriceCurrency
Returns the currency code of the product's RRP price tier.
Parameters ​
product ​
The product object.
Returns ​
string
The ISO 4217 currency code string, or an empty string if not set.
getSalableVariationCount ​
getSalableVariationCount: (
product) =>number
Returns the total number of salable variations for the product.
Parameters ​
product ​
The product object.
Returns ​
number
The salable variation count, or 0 if not set.
getSecondCoverImage ​
getSecondCoverImage: (
product) =>string
Returns the normal-size URL of the product's second cover image.
Parameters ​
product ​
The product object.
Returns ​
string
The second cover image URL, or an empty string if not available.
getSecondPreviewImage ​
getSecondPreviewImage: (
product) =>string
Returns the second preview image URL, preferring a variation-specific image over the general item image.
Parameters ​
product ​
The product object.
Returns ​
string
The second preview image URL, or an empty string if not available.
getShortDescription ​
getShortDescription: (
product) =>string
Returns the short description of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The short description, or an empty string if not set.
getSlug ​
getSlug: (
product) =>string
Returns the URL slug (last segment of the URL path) of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The slug string, or an empty string if not set.
getSpecialOffer ​
getSpecialOffer: (
product) =>number|null=productPriceGetters.getSpecialOffer
Returns the special offer unit price of the product.
Parameters ​
product ​
The product object.
Returns ​
number | null
The special offer price as a number, or null if not set.
getSpecialPriceCurrency ​
getSpecialPriceCurrency: (
product) =>string=productPriceGetters.getSpecialPriceCurrency
Returns the currency code of the product's default price tier.
Parameters ​
product ​
The product object.
Returns ​
string
The ISO 4217 currency code string (e.g. "EUR"), or an empty string if not set.
getTechnicalData ​
getTechnicalData: (
product) =>string
Returns the technical data text of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The technical data string, or an empty string if not set.
getTitle ​
getTitle: (
product) =>string
Returns the SEO title of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The product title, or an empty string if not set.
getTotalReviews ​
getTotalReviews: (
product) =>number
Returns the total number of customer reviews for the product.
Parameters ​
product ​
The product object.
Returns ​
number
The review count, or 0 if not set.
getUnitContent ​
getUnitContent: (
product) =>number
Returns the unit content quantity of the product (e.g. 500 for 500 ml).
Parameters ​
product ​
The product object.
Returns ​
number
The unit content as a number.
getUnitName ​
getUnitName: (
product) =>string
Returns the unit name of the product (e.g. "ml", "kg").
Parameters ​
product ​
The product object.
Returns ​
string
The unit name string.
getUnits ​
getUnits: (
products) =>Record<number,string>
Builds a map of unit combination IDs to unit names from all product variations.
Parameters ​
products ​
Product[]
An array of product objects.
Returns ​
Record<number, string>
A record mapping unitCombinationId to its display name.
getUrlPath ​
getUrlPath: (
product) =>string
Returns the full URL path of the product.
Parameters ​
product ​
The product object.
Returns ​
string
The URL path string, or an empty string if not set.
getVariariationById ​
getVariariationById: (
product,variationId) =>VariationMapProductVariation|null
Returns the variation matching the given variation ID, or null if not found.
Parameters ​
product ​
The product object.
variationId ​
number
The numeric ID of the variation to look up.
Returns ​
VariationMapProductVariation | null
The matching VariationMapProductVariation, or null.
getVariationAvailableUntil ​
getVariationAvailableUntil: (
product) =>unknown
Returns the date until which the variation is available for sale.
Parameters ​
product ​
The product object.
Returns ​
unknown
The availability end date value.
getVariationId ​
getVariationId: (
product) =>number
Returns the numeric ID of the current product variation.
Parameters ​
product ​
The product object.
Returns ​
number
The variation ID, or 0 if not set.
getVariationIdForAttributes ​
getVariationIdForAttributes: (
product,selectedAttributId,unitCombinationId) =>number
Finds the variation ID that matches a given attribute value and unit combination.
Parameters ​
product ​
The product object.
selectedAttributId ​
string
The ID of the selected attribute value as a string.
unitCombinationId ​
string | null
The unit combination ID to match, or null to ignore unit filtering.
Returns ​
number
The matching variation ID, or -1 if no match is found.
getVariationNumber ​
getVariationNumber: (
product) =>string
Returns the variation number (SKU / external ID) of the product variation.
Parameters ​
product ​
The product object.
Returns ​
string
The variation number string, or an empty string if not set.
getWeightG ​
getWeightG: (
product) =>number
Returns the weight of the product variation in grams.
Parameters ​
product ​
The product object.
Returns ​
number
The weight in grams, or 0 if not set.
getWidthMM ​
getWidthMM: (
product) =>number
Returns the width of the product variation in millimeters.
Parameters ​
product ​
The product object.
Returns ​
number
The width in mm, or 0 if not set.
hasOrderPropertiesRequiredAndPreselected ​
hasOrderPropertiesRequiredAndPreselected: (
product) =>boolean
Returns true if the product has order properties and all of them are required and preselected.
Parameters ​
product ​
The product object.
Returns ​
boolean
true when all order properties are required and already preselected.
isActiveVariationSalable ​
isActiveVariationSalable: (
product) =>boolean
Returns true if the currently active variation of the product is salable.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the active variation is salable, otherwise false.
isSalable ​
isSalable: (
product) =>boolean
Returns true if at least one variation of the product is salable.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if any variation is salable, otherwise false.
possibleUnitCombination ​
possibleUnitCombination: (
product) =>VariationMapProductVariation[]
Returns the unique unit combinations available for the product. Filters out duplicate unitCombinationId entries, keeping the first occurrence.
Parameters ​
product ​
The product object.
Returns ​
VariationMapProductVariation[]
An array of VariationMapProductVariation objects with distinct unit combinations.
shouldAppendVariationToLink ​
shouldAppendVariationToLink: (
product) =>boolean
Determines whether the variation ID should be appended to the product URL. Returns true if there is exactly one salable variation with a valid variation ID, or if the product has any grouped attributes.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the variation should be included in the link.
showFromText ​
showFromText: (
product) =>boolean
Determines whether a "from" price prefix should be shown for the product. Returns true when the product has multiple salable variations with cheapest-sorting enabled, or when a single variation has more than one graduated price step. Always returns false for set items.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the "from" prefix should be displayed alongside the price.
showPricePerUnit ​
showPricePerUnit: (
product) =>boolean=productPriceGetters.showPricePerUnit
Returns whether the per-unit price should be displayed for the product. Returns false when the unit of measurement is "C62" (piece) and the content is 1, as no separate per-unit price label is meaningful in that case.
Parameters ​
product ​
The product object.
Returns ​
boolean
true if the per-unit price should be shown, otherwise false.