@plentymarkets/shop-api / wishlistGetters
Variable: wishlistGetters ​
constwishlistGetters:object
Defined in: getters/wishlistGetters.ts:184
Type Declaration ​
canDirectlyAddToCart ​
canDirectlyAddToCart: (
wishlistItem) =>boolean
Returns whether a wishlist item can be added directly to the cart without further user interaction. Returns true only when the item is salable, has no order properties, is not a set item, has a minimum quantity of 1, an interval quantity of 1, has the canDirectlyAddToCart flag set, and has no graduated prices.
Parameters ​
wishlistItem ​
The wishlist item.
Returns ​
boolean
true if the item can be directly added to the cart, otherwise false.
getCanDirectlyAddToCart ​
getCanDirectlyAddToCart: (
wishlistItem) =>number
Returns the raw canDirectlyAddToCart flag value from a wishlist item.
Parameters ​
wishlistItem ​
The wishlist item.
Returns ​
number
The numeric flag value, or 0 if not set.
getFormattedPrice ​
getFormattedPrice: (
price) =>string
Returns the price as a formatted string.
Parameters ​
price ​
number
The numeric price value.
Returns ​
string
The price as a string, or an empty string if the value is falsy.
getId ​
getId: (
product) =>string
Returns the variation ID of a wishlist item as a string.
Parameters ​
product ​
The wishlist item.
Returns ​
string
The variation ID string, or an empty string if not set.
getItemAttributes ​
getItemAttributes: (
item,filters?) =>Record<string,AgnosticAttribute|string>
Parameters ​
item ​
The wishlist item (currently unused).
filters? ​
string[]
Optional attribute filter list (currently unused).
Returns ​
Record<string, AgnosticAttribute | string>
A record containing a placeholder "color" attribute set to "red".
Deprecated ​
Not yet implemented — always returns a placeholder color attribute.
getItemImage ​
getItemImage: () =>
string
Returns ​
string
An empty string.
Deprecated ​
Not yet implemented — always returns an empty string.
getItemName ​
getItemName: (
item) =>string
Returns the display name (name1) of a wishlist item.
Parameters ​
item ​
The wishlist item.
Returns ​
string
The name string, or an empty string if not set.
getItemPrice ​
getItemPrice: (
item) =>number|null
Returns the default unit price of a wishlist item.
Parameters ​
item ​
The wishlist item.
Returns ​
number | null
The price as a number, or null if not set.
getItemQty ​
getItemQty: (
item) =>number
Parameters ​
item ​
The wishlist item (currently unused).
Returns ​
number
Always 1.
Deprecated ​
Not yet implemented — always returns 1.
getItems ​
getItems: (
wishlist) =>Product[]
Returns all items in the wishlist.
Parameters ​
wishlist ​
The wishlist object containing an items array.
items ​
Product[]
Returns ​
Product[]
An array of WishlistItem objects, or an empty array if none exist.
getItemSku ​
getItemSku: (
item) =>string
Parameters ​
item ​
The wishlist item (currently unused).
Returns ​
string
An empty string.
Deprecated ​
Not yet implemented — always returns an empty string.
getRegularItemPrice ​
getRegularItemPrice: (
item) =>number
Returns the regular (RRP) price of a wishlist item.
Parameters ​
item ​
The wishlist item.
Returns ​
number
The RRP price value, or 0 if not set.
getShippingPrice ​
getShippingPrice: (
wishlist) =>number
Parameters ​
wishlist ​
The wishlist object (currently unused).
items ​
Product[]
Returns ​
number
Always 0.
Deprecated ​
Not yet implemented — always returns 0.
getSpecialItemPrice ​
getSpecialItemPrice: (
item) =>number
Returns the special (sale) price of a wishlist item.
Parameters ​
item ​
The wishlist item.
Returns ​
number
The special price value, or 0 if not set.
getTotalItems ​
getTotalItems: (
wishlist) =>number
Returns the total number of items in the wishlist.
Parameters ​
wishlist ​
The wishlist object.
items ​
Product[]
Returns ​
number
The number of wishlist items, or 0 if the wishlist is empty.
getTotals ​
getTotals: (
wishlist) =>AgnosticTotals
Parameters ​
wishlist ​
The wishlist object (currently unused).
items ​
Product[]
Returns ​
AgnosticTotals
An AgnosticTotals object with total and subtotal both set to 0.
Deprecated ​
Not yet implemented — always returns zero totals.