@plentymarkets/shop-api / cartGetters
Variable: cartGetters ​
constcartGetters:object
Defined in: getters/cartGetters.ts:585
Type Declaration ​
getBasketAmountNet ​
getBasketAmountNet: (
cart) =>number
Returns the net basket amount of the cart (excluding VAT).
Parameters ​
cart ​
The cart object.
Returns ​
number
The net basket amount, or 0 if not set.
getBasketItemOrderParamBasketItemId ​
getBasketItemOrderParamBasketItemId: (
item) =>number
Returns the cart item ID that the basket item order parameter belongs to.
Parameters ​
item ​
The basket item order parameter.
Returns ​
number
The basket item ID as a number.
getBasketItemOrderParamName ​
getBasketItemOrderParamName: (
item) =>string
Returns the display name of a basket item order parameter.
Parameters ​
item ​
The basket item order parameter.
Returns ​
string
The name string.
getBasketItemOrderParamPrice ​
getBasketItemOrderParamPrice: (
item) =>number
Returns the price of a basket item order parameter.
Parameters ​
item ​
The basket item order parameter.
Returns ​
number
The price as a number.
getBasketItemOrderParamPropertyId ​
getBasketItemOrderParamPropertyId: (
item) =>string
Returns the property ID of a basket item order parameter.
Parameters ​
item ​
The basket item order parameter.
Returns ​
string
The property ID string.
getBasketItemOrderParams ​
getBasketItemOrderParams: (
item) =>BasketItemOrderParam[]
Returns the basket item order parameters (order properties) for a cart item.
Parameters ​
item ​
The cart item.
Returns ​
An array of BasketItemOrderParam objects.
getBasketItemOrderParamType ​
getBasketItemOrderParamType: (
item) =>string
Returns the type of a basket item order parameter (e.g. "text", "file", "selection").
Parameters ​
item ​
The basket item order parameter.
Returns ​
string
The type string.
getBasketItemOrderParamValue ​
getBasketItemOrderParamValue: (
item) =>string
Returns the value of a basket item order parameter.
Parameters ​
item ​
The basket item order parameter.
Returns ​
string
The value string.
getCartItemPrice ​
getCartItemPrice: (
item) =>number
Returns the unit price of a cart item.
Parameters ​
item ​
The cart item.
Returns ​
number
The item price as a number.
getCouponCampaignType ​
getCouponCampaignType: (
cart) =>string
Returns the coupon campaign type applied to the cart.
Parameters ​
cart ​
The cart object.
Returns ​
string
The coupon campaign type string, or an empty string if not set.
getCouponCode ​
getCouponCode: (
cart) =>string
Returns the coupon code applied to the cart.
Parameters ​
cart ​
The cart object.
Returns ​
string
The coupon code string, or an empty string if not set.
getCouponDiscount ​
getCouponDiscount: (
cart) =>number
Returns the coupon discount amount applied to the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number
The coupon discount, or 0 if not set.
getCoupons ​
getCoupons: (
cart) =>AgnosticCoupon[]
Parameters ​
cart ​
The cart object (currently unused).
Returns ​
AgnosticCoupon[]
An empty array.
Deprecated ​
Not yet implemented — always returns an empty array.
getCurrency ​
getCurrency: (
cart) =>string
Returns the currency code used in the cart.
Parameters ​
cart ​
The cart object.
Returns ​
string
The ISO 4217 currency code string (e.g. "EUR").
getCustomerInvoiceAddressId ​
getCustomerInvoiceAddressId: (
cart) =>number|null
Returns the invoice address ID associated with the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number | null
The customer invoice address ID, or null if not set.
getCustomerShippingAddressId ​
getCustomerShippingAddressId: (
cart) =>number|null
Returns the shipping address ID associated with the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number | null
The customer shipping address ID, or null if not set.
getDiscounts ​
getDiscounts: (
cart) =>AgnosticDiscount[]
Parameters ​
cart ​
The cart object (currently unused).
Returns ​
AgnosticDiscount[]
An empty array.
Deprecated ​
Not yet implemented — always returns an empty array.
getFormattedPrice ​
getFormattedPrice: (
price) =>string
Parameters ​
price ​
number
The price to format (currently unused).
Returns ​
string
An empty string.
Deprecated ​
Not yet implemented — always returns an empty string.
getItemAttributes ​
getItemAttributes: (
item) =>AgnosticAttribute[]
Returns the attributes of the product variation in a cart item as agnostic attribute objects.
Parameters ​
item ​
The cart item.
Returns ​
AgnosticAttribute[]
An array of AgnosticAttribute objects, or an empty array if no attributes are set.
getItemId ​
getItemId: (
item) =>number
Returns the unique ID of the cart item.
Parameters ​
item ​
The cart item.
Returns ​
number
The cart item ID, or 0 if not set.
getItemImage ​
getItemImage: (
item) =>string
Returns the small-size cover image URL for the product in a cart item.
Parameters ​
item ​
The cart item.
Returns ​
string
The cover image preview URL, or an empty string if the variation is not set.
getItemName ​
getItemName: (
item) =>string
Returns the display name of the product associated with a cart item.
Parameters ​
item ​
The cart item.
Returns ​
string
The product name, or an empty string if the variation is not set.
getItemPrice ​
getItemPrice: (
item) =>number|null
Returns the unit price of the product in a cart item.
Parameters ​
item ​
The cart item.
Returns ​
number | null
The price as a number, or null if the variation is not set.
getItemQty ​
getItemQty: (
item) =>number
Returns the quantity of a cart item.
Parameters ​
item ​
The cart item.
Returns ​
number
The quantity, defaulting to 1 if not set.
getItems ​
getItems: (
cart) =>CartItem[]
Returns all items in the cart.
Parameters ​
cart ​
The cart object.
Returns ​
CartItem[]
An array of CartItem objects, or an empty array if the cart has no items.
getItemSku ​
getItemSku: (
item) =>string
Parameters ​
item ​
The cart item (currently unused).
Returns ​
string
An empty string.
Deprecated ​
Not yet implemented — always returns an empty string.
getItemSumNet ​
getItemSumNet: (
cart) =>number
Returns the net item sum of the cart (excluding VAT).
Parameters ​
cart ​
The cart object.
Returns ​
number
The net item sum, or 0 if not set.
getMaxDeliveryDays ​
getMaxDeliveryDays: (
cart,shippingMethodId) =>number|null
Returns the maximum delivery days for a given shipping method in the cart.
Parameters ​
cart ​
The cart object.
shippingMethodId ​
number
The ID of the shipping method to look up.
Returns ​
number | null
The maximum delivery days, or null if the data is not available.
getOpenAmount ​
getOpenAmount: (
cart) =>number|null
Returns the outstanding open amount for the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number | null
The open amount, or null if not set.
getOrderPropertiesAdditionalCostsWithVat ​
getOrderPropertiesAdditionalCostsWithVat: (
cart) =>BasketItemOrderParam[]
Returns all basket item order parameters for the cart that are marked as additional costs and have a "incl" surcharge type (i.e. their surcharge includes VAT).
Parameters ​
cart ​
The cart object.
Returns ​
An array of BasketItemOrderParam objects with aggregated prices.
getOrderPropertiesWithoutVat ​
getOrderPropertiesWithoutVat: (
cart) =>BasketItemOrderParam[]
Returns all basket item order parameters for the cart that have a "plus" surcharge type (i.e. order properties whose surcharge is shown separately, without VAT).
Parameters ​
cart ​
The cart object.
Returns ​
An array of BasketItemOrderParam objects with aggregated prices.
getProductPath ​
getProductPath: (
item,useCallistoPattern) =>string
Returns the URL path to the product page for a cart item. Supports the legacy Callisto URL pattern when useCallistoPattern is true.
Parameters ​
item ​
The cart item.
useCallistoPattern? ​
boolean = false
When true, appends the item ID using the Callisto pattern (/a-{itemId}); otherwise uses the Ceres pattern (_{itemId}_{variationId}).
Returns ​
string
The product URL path, or an empty string if the variation URL path is not set.
getPropertyFromCartItem ​
getPropertyFromCartItem: (
item,propertyId) =>ProductProperty|null
Returns the product property with the given ID from a cart item's variation.
Parameters ​
item ​
The cart item.
propertyId ​
number
The numeric ID of the property to look up.
Returns ​
ProductProperty | null
The matching ProductProperty, or null if not found.
getShippingAmount ​
getShippingAmount: (
total) =>number
Returns the shipping amount from an agnostic totals object.
Parameters ​
total ​
The agnostic totals object.
Returns ​
number
The shipping amount, or 0 if not set.
getShippingAmountNet ​
getShippingAmountNet: (
cart) =>number
Returns the net shipping amount of the cart (excluding VAT).
Parameters ​
cart ​
The cart object.
Returns ​
number
The net shipping amount, or 0 if not set.
getShippingCountryId ​
getShippingCountryId: (
cart?) =>number
Returns the shipping country ID set on the cart.
Parameters ​
cart? ​
The cart object (optional).
Returns ​
number
The shipping country ID, or 0 if not set.
getShippingPrice ​
getShippingPrice: (
cart) =>number
Returns the shipping price of the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number
The shipping amount, or 0 if not set.
getShopCountryId ​
getShopCountryId: (
cart?) =>number
Returns the shop country ID set on the cart.
Parameters ​
cart? ​
The cart object (optional).
Returns ​
number
The shop country ID, or 0 if not set.
getSubTotal ​
getSubTotal: (
total) =>number
Returns the subtotal (item sum) from an agnostic totals object.
Parameters ​
total ​
AgnosticTotals
The agnostic totals object.
Returns ​
number
The subtotal, or 0 if not set.
getToBePayed ​
getToBePayed: (
total) =>number
Returns the amount yet to be paid from an agnostic totals object.
Parameters ​
total ​
The agnostic totals object.
Returns ​
number
The amount to be paid, or 0 if not set.
getTotal ​
getTotal: (
total) =>number
Returns the gross total from an agnostic totals object.
Parameters ​
total ​
AgnosticTotals
The agnostic totals object.
Returns ​
number
The total, or 0 if not set.
getTotalItems ​
getTotalItems: (
cart) =>number
Returns the total number of distinct line items in the cart.
Parameters ​
cart ​
The cart object.
Returns ​
number
The number of cart items, or 0 if the cart is empty.
getTotals ​
getTotals: (
cart) =>AgnosticTotals
Returns the aggregated totals for the cart.
Parameters ​
cart ​
The cart object.
Returns ​
AgnosticTotals
An AgnosticTotals object with total, subtotal, shipping, rebate, coupon discount, VATs, and the amount to be paid.
getTotalVatAmount ​
getTotalVatAmount: (
totalVat) =>number
Returns the VAT amount (monetary value) from a cart VAT entry.
Parameters ​
totalVat ​
A cart VAT entry.
Returns ​
number
The VAT amount, or 0 if not set.
getTotalVatValue ​
getTotalVatValue: (
totalVat) =>number
Returns the VAT value (rate) from a cart VAT entry.
Parameters ​
totalVat ​
A cart VAT entry.
Returns ​
number
The VAT value, or 0 if not set.
getVariation ​
getVariation: (
item) =>Product|null
Returns the product variation associated with a cart item.
Parameters ​
item ​
The cart item.
Returns ​
Product | null
The Product object, or null if not set.
getVariationBundleComponents ​
getVariationBundleComponents: (
item) =>ProductBundleComponent[] |null
Returns the bundle components of the product variation in a cart item.
Parameters ​
item ​
The cart item.
Returns ​
ProductBundleComponent[] | null
An array of ProductBundleComponent objects, or null if none are set.
getVariationId ​
getVariationId: (
item) =>number
Returns the variation ID of a cart item.
Parameters ​
item ​
The cart item.
Returns ​
number
The variation ID, or 0 if not set.
getVatAmount ​
getVatAmount: (
total) =>number
Returns the VAT amount from an agnostic totals object.
Parameters ​
total ​
The agnostic totals object.
Returns ​
number
The VAT amount, or 0 if not set.
getVatValue ​
getVatValue: (
total) =>number
Returns the VAT value (rate) from an agnostic totals object.
Parameters ​
total ​
The agnostic totals object.
Returns ​
number
The VAT value, or 0 if not set.