Application providing the shopping cart and checkout used to purchase products, including those opted into reward programs and paid for with accumulated points. Registers the shopping cart, checkout form and purchased-products KEditor components, calculates promotional discounts and gifts against the items in a cart, and exposes cart and order lookups (such as counts of unfulfilled orders) used by admin and website templates. It is reached from Java and templates through the application context as ShoppingCartApp, and is required by other apps, such as Products and Rewards, that allow purchases.

Implements: Application, MenuApplication, ChildPageApplication, PortletApplication, TemplatingApplication, ComponentApplication, DependentApplication, SettingsApplication


Properties

PropertyReturnsDescription
cashTopupsEnabledbooleanWhether cash topups are enabled for the current organisation and website branch, resolved from the current request's root folder.
countOfOrdersLongReturns orders created between the common start and end dates
instanceIdStringUnique identifier this application is registered under.
paymentAppPaymentProviderApplicationFinds the active application that provides payment processing for the current organisation.
rolesList<Role>Security roles this application registers. The shopping cart application does not register any roles of its own.
unfulfilledOrdersLongNumber of orders that have not yet been fulfilled, for the current organisation.
userPromoCodesList<String>Promo codes provided by the current user, read from the "promoCodes" request parameter if present, otherwise from the "promoCodes" cookie.

Methods

registerCurrency(Currency currency) · getInstanceId() · getRoles() · getDescription(ShoppingCartBean shoppingCartBean) · getDescription(Cart cart) · isCashTopupsEnabled() · isCashTopupsEnabled(Organisation org, Branch websiteBranch) · getPaymentApp() · calcPromotionalItems(List<ShoppingCartItemBean> shoppingCartItemBeans) · getUserPromoCodes() · getUnfulfilledOrders() · getCountOfOrders() · searchCarts(String fulfilment, int max, String query)

registerCurrency(Currency currency)

Returns: void

Registers a currency for use by the shopping cart, keyed by its currency id.

ParameterDescription
currencythe currency to register

getInstanceId()

Returns: String

Unique identifier this application is registered under.

getRoles()

Returns: List<Role>

Security roles this application registers. The shopping cart application does not register any roles of its own.

getDescription(ShoppingCartBean shoppingCartBean)

Returns: String

Get a description of the items in the cart.

ParameterDescription
shoppingCartBeanthe cart bean to describe

getDescription(Cart cart)

Returns: String

Get a description of the items in the cart.

ParameterDescription
cartthe cart to describe

isCashTopupsEnabled()

Returns: boolean

Whether cash topups are enabled for the current organisation and website branch, resolved from the current request's root folder.

isCashTopupsEnabled(Organisation org, Branch websiteBranch)

Returns: boolean

Whether cash topups are enabled for the given organisation and website branch. When a website branch is given the setting is read from the branch, otherwise it is read from the organisation.

ParameterDescription
orgthe organisation to check the setting for
websiteBranchthe website branch to check the setting for, or null to check the organisation-level setting

getPaymentApp()

Returns: PaymentProviderApplication

Finds the active application that provides payment processing for the current organisation.

calcPromotionalItems(List<ShoppingCartItemBean> shoppingCartItemBeans)

Returns: List<IPromotionItem>

Look for all active promotions (aka rewards) and compile a list of items

ParameterDescription
shoppingCartItemBeansthe items currently in the cart, checked against each active reward's discount and gift conditions

getUserPromoCodes()

Returns: List<String>

Promo codes provided by the current user, read from the "promoCodes" request parameter if present, otherwise from the "promoCodes" cookie.

getUnfulfilledOrders()

Returns: Long

Number of orders that have not yet been fulfilled, for the current organisation.

getCountOfOrders()

Returns: Long

Returns orders created between the common start and end dates

searchCarts(String fulfilment, int max, String query)

Returns: List<Cart>

Searches for carts matching the given fulfilment status, up to a maximum number of results.

ParameterDescription
fulfilmentthe fulfilment status to filter by, or null to match any status
maxthe maximum number of results to return
queryfree text to search for, or null to not filter by text
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.