@plentymarkets/shop-api / productPriceGetters
Variable: productPriceGetters ​
constproductPriceGetters:object
Defined in: getters/productPriceGetters.ts:202
Type Declaration ​
getCheapestGraduatedPrice ​
getCheapestGraduatedPrice: (
product) =>number
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.
getCheapestGraduatedPriceFormatted ​
getCheapestGraduatedPriceFormatted: (
product) =>string
Returns the formatted cheapest graduated unit price string for the product.
Parameters ​
product ​
The product object.
Returns ​
string
The formatted price string (e.g. "9,99 €"), or an empty string if not available.
getCrossedPrice ​
getCrossedPrice: (
product) =>number|null
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.
getCrossedPriceFormatted ​
getCrossedPriceFormatted: (
product) =>string
Returns the formatted RRP (crossed-out) unit price string for the product.
Parameters ​
product ​
The product object.
Returns ​
string
The formatted RRP price string, or an empty string if not set.
getDefaultBasePrice ​
getDefaultBasePrice: (
product) =>string
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
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.
getGraduatedList ​
getGraduatedList: (
product) =>GraduatedPriceList[]
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
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[]
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.
getLowestPrice ​
getLowestPrice: (
product) =>number|null
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.
getPrice ​
getPrice: (
product) =>number|null
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.
getPriceFormatted ​
getPriceFormatted: (
product) =>string
Returns the formatted default unit price string for the product.
Parameters ​
product ​
The product object.
Returns ​
string
The formatted price string (e.g. "19,99 €"), or an empty string if not set.
getRegularPriceCurrency ​
getRegularPriceCurrency: (
product) =>string
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.
getSpecialOffer ​
getSpecialOffer: (
product) =>number|null
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.
getSpecialOfferFormatted ​
getSpecialOfferFormatted: (
product) =>string
Returns the formatted special offer unit price string for the product.
Parameters ​
product ​
The product object.
Returns ​
string
The formatted special offer price string, or an empty string if not set.
getSpecialPriceCurrency ​
getSpecialPriceCurrency: (
product) =>string
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.
showPricePerUnit ​
showPricePerUnit: (
product) =>boolean
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.