menu

SFRA / Server-side JS / Namespace: Cart

Cart

Methods

(static) Base/Cart-AddBonusProducts()

Cart-AddBonusProducts : The Cart-AddBonusProducts endpoint handles adding bonus products to basket

Parameters:
Type Description
querystringparameter

pids - an object containing: 1. totalQty (total quantity of total bonus products) 2. a list of bonus products with each index being an object containing pid (product id of the bonus product), qty (quantity of the bonus product), a list of options of the bonus product

querystringparameter

uuid - UUID of the mian product

querystringparameter

pliuud - UUID of the bonus product line item

category

sensitive

returns

json

serverfunction

post

Source:

(static) Base/Cart-AddCoupon()

Cart-AddCoupon : The Cart-AddCoupon endpoint is responsible for adding a coupon to a basket

Parameters:
Type Description
middleware

server.middleware.https

middleware

csrfProtection.validateAjaxRequest

querystringparameter

couponCode - the coupon code to be applied

querystringparameter

csrf_token - hidden input field csrf token

category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-AddProduct(-json)

Cart-AddProduct : The Cart-MiniCart endpoint is responsible for displaying the cart icon in the header with the number of items in the current basket

Parameters:
Name Type Description
httpparameter

pid - product ID

httpparameter

quantity - quantity of product

httpparameter

options - list of product options

category

sensitive

-json returns
serverfunction

post

Source:

(static) Base/Cart-EditBonusProduct()

Cart-EditBonusProduct : The Cart-EditBonusProduct endpoint is responsible for editing the bonus products in a basket

Parameters:
Type Description
querystringparameter

duuid - discount line item UUID

category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-EditProductLineItem()

Cart-EditProductLineItem : The Cart-EditProductLineItem endpoint edits a product line item in the basket on cart page

Parameters:
Type Description
httpparameter

uuid - UUID of product line item being edited

httpparameter

pid - Product ID

httpparameter

quantity - Quantity

httpparameter

selectedOptionValueId - ID of selected option

category

sensitive

returns

json

serverfunction

post

Source:

(static) Base/Cart-Get()

Cart-Get : The Cart-Get endpoints is responsible for returning the current basket in JSON format

Parameters:
Type Description
category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-GetProduct()

Cart-GetProduct : The Cart-GetProduct endpoint handles showing the product details in a modal/quickview for editing a product in basket on cart page

Parameters:
Type Description
querystringparameter

uuid - UUID of the product line item (to edit)

category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-MiniCart()

Cart-MiniCart : The Cart-MiniCart endpoint is responsible for displaying the cart icon in the header with the number of items in the current basket

Parameters:
Type Description
middleware

server.middleware.include

category

sensitive

renders

isml

serverfunction

get

Source:

(static) Base/Cart-MiniCartShow()

Cart-MiniCartShow : The Cart-MiniCartShow is responsible for getting the basket and showing the contents when you hover over minicart in header

Parameters:
Type Description
category

sensitive

renders

isml

serverfunction

get

Source:

(static) Base/Cart-RemoveCouponLineItem()

Cart-RemoveCouponLineItem : The Cart-RemoveCouponLineItem endpoint is responsible for removing a coupon from a basket

Parameters:
Type Description
querystringparameter

code - the coupon code

querystringparameter

uuid - the UUID of the coupon line item object

category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-RemoveProductLineItem()

Cart-RemoveProductLineItem : The Cart-RemoveProductLineItem endpoint removes a product line item from the basket

Parameters:
Type Description
querystringparameter

pid - the product id

querystringparameter

uuid - the universally unique identifier of the product object

category

sensitive

returns

json

serverfunction

get

Source:

(static) Base/Cart-SelectShippingMethod()

Cart-SelectShippingMethod : The Cart-SelectShippingMethod endpoint is responsible for assigning a shipping method to the shipment in basket

Parameters:
Type Description
middleware

server.middleware.https

querystringparameter

methodID - ID of the selected shipping method

querystringparameter

shipmentUUID - UUID of the shipment object

httpparameter

methodID - ID of the selected shipping method

httpparameter

shipmentUUID - UUID of the shipment object

category

sensitive

returns

json

serverfunction

post

Source:

(static) Base/Cart-Show()

Cart-Show : The Cart-Show endpoint renders the cart page with the current basket

Parameters:
Type Description
middleware

server.middleware.https

middleware

consentTracking.consent

middleware

csrfProtection.generateToken

category

sensitive

renders

isml

serverfunction

get

Source:

(static) Base/Cart-UpdateQuantity()

Cart-UpdateQuantity : The Cart-UpdateQuantity endpoint handles updating the quantity of a product line item in the basket

Parameters:
Type Description
querystringparameter

pid - the product id

querystringparameter

quantity - the quantity to be updated for the line item

querystringparameter

uuid - the universally unique identifier of the product object

category

sensitive

returns

json

serverfunction

get

Source:

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.