@plentymarkets/shop-api / productBundleGetters
Variable: productBundleGetters ​
constproductBundleGetters:object
Defined in: getters/productBundleGetters.ts:124
Type Declaration ​
getBundleDiscount ​
getBundleDiscount: (
product) =>number
Returns the bundle discount percentage for a product. Calculates the percentage discount between the regular price and the bundle price. Returns 0 if the product has no bundle components or if the crossed price is zero.
Parameters ​
product ​
The product object.
Returns ​
number
The discount percentage as a rounded integer (e.g. 20 for 20% off).
getBundleItemDescription ​
getBundleItemDescription: (
productBundleComponent) =>string
Returns the full HTML description of a bundle component item.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The description string, or an empty string if not set.
getBundleItemImage ​
getBundleItemImage: (
productBundleComponent) =>string
Returns the preview image URL for a bundle component item. Prefers the variation-specific preview image, then the general image preview, then the full image URL.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The image URL string.
getBundleItemName ​
getBundleItemName: (
productBundleComponent) =>string
Returns the name (name1) of the product in a bundle component.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The name string, or an empty string if not set.
getBundleItemQuantity ​
getBundleItemQuantity: (
productBundleComponent) =>string
Returns the quantity of a product within a bundle component.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The quantity string, or an empty string if not set.
getBundleItemShortDescription ​
getBundleItemShortDescription: (
productBundleComponent) =>string
Returns the short description of a bundle component item.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The short description string, or an empty string if not set.
getBundleItemUrl ​
getBundleItemUrl: (
productBundleComponent) =>string
Returns the URL path to the product page of a bundle component item. Combines the URL path, item ID, and variation ID in "/<urlPath>_<itemId>_<variationId>" format.
Parameters ​
productBundleComponent ​
The bundle component object.
Returns ​
string
The product URL path string.
isItemBundleSalable ​
isItemBundleSalable: (
item) =>boolean
Returns whether a bundle component item is salable.
Parameters ​
item ​
The bundle component object.
Returns ​
boolean
true if the item's variation is salable, otherwise false.
isItemBundleSalableAndActive ​
isItemBundleSalableAndActive: (
item) =>boolean
Returns whether a bundle component item is both salable and active.
Parameters ​
item ​
The bundle component object.
Returns ​
boolean
true if the item's variation is salable and active, otherwise false.