public class BasketMgr extends BaseMgr
Modifier | Constructor and Description |
---|---|
protected |
BasketMgr(com.konakart.appif.KKEngIf eng,
KKAppEng kkAppEng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addToBasket(com.konakart.appif.BasketIf item,
boolean refresh)
Saves a new Basket object in the database for the current customer.
|
void |
addToBasketWithOptions(com.konakart.appif.BasketIf item,
com.konakart.appif.AddToBasketOptionsIf options,
boolean refresh)
Saves a new Basket object in the database for the current customer.
|
void |
emptyBasket()
All items in the basket are removed from the database and the array of basket items for the
current customer, are deleted.
|
com.konakart.appif.AddToBasketOptionsIf |
getAddToBasketOptions()
Creates an AddToBasketOptionsIf based on the current FetchProductOptions stored in the
AppEng.
|
void |
getBasketItemsPerCustomer()
Get the basket items for a customer and language and set them on the customer customer object
of the customerMgr.
|
java.math.BigDecimal |
getBasketTotal()
Returns the total price of the basket as a BigDecimalValue
|
java.lang.String |
getFormattedBasketTotal()
Returns the total price of the basket as a formatted string so that it may be used directly
in the UI.
|
int |
getNumberOfItems() |
com.konakart.appif.StockReservationOptionsIf |
getStockReservationOptions()
Creates a StockReservationOptions object based on the current FetchProductOptions stored in
the AppEng.
|
void |
removeFromBasket(com.konakart.appif.BasketIf item,
boolean refresh)
The Basket object is removed from the database and so no longer appears in the customer's
basket.
|
com.konakart.appif.BasketIf[] |
reserveStock(com.konakart.appif.BasketIf[] basketItems)
Before calling the engine we save any attached products and re-attach them on the returned
basket items
|
void |
setBasketTotal(java.math.BigDecimal basketTotal) |
void |
updateBasket(com.konakart.appif.BasketIf item,
boolean refresh)
Updates the Basket object in the database.
|
com.konakart.appif.BasketIf[] |
updateBasketWithStockInfo(com.konakart.appif.BasketIf[] basketItems)
Before calling the engine we save any attached products and re-attach them on the returned
basket items
|
getEng, getKkAppEng, getPages, isMgrReady, setEng, setKkAppEng
protected BasketMgr(com.konakart.appif.KKEngIf eng, KKAppEng kkAppEng) throws com.konakart.app.KKException
eng
- the engkkAppEng
- the kkAppEngcom.konakart.app.KKException
- an unexpected KKException exceptionpublic void getBasketItemsPerCustomer() throws com.konakart.app.KKException, KKAppException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void emptyBasket() throws com.konakart.app.KKException, KKAppException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void removeFromBasket(com.konakart.appif.BasketIf item, boolean refresh) throws com.konakart.app.KKException, KKAppException
item
- The basket object to be removedrefresh
- If set to true, the current customer's basket is refreshedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void addToBasket(com.konakart.appif.BasketIf item, boolean refresh) throws com.konakart.app.KKException, KKAppException
item
- The basket object to be addedrefresh
- If set to true, the current customer's basket is refreshedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void addToBasketWithOptions(com.konakart.appif.BasketIf item, com.konakart.appif.AddToBasketOptionsIf options, boolean refresh) throws com.konakart.app.KKException, KKAppException
item
- The basket object to be addedoptions
- An object containing options for the method. It may be set to null.refresh
- If set to true, the current customer's basket is refreshedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic void updateBasket(com.konakart.appif.BasketIf item, boolean refresh) throws com.konakart.app.KKException, KKAppException
item
- The basket object to be updatedrefresh
- If set to true, the current customer's basket is refreshedcom.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic java.lang.String getFormattedBasketTotal() throws com.konakart.app.KKException, KKAppException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic java.math.BigDecimal getBasketTotal() throws com.konakart.app.KKException, KKAppException
com.konakart.app.KKException
- an unexpected KKException exceptionKKAppException
- an unexpected KKAppException exceptionpublic com.konakart.appif.AddToBasketOptionsIf getAddToBasketOptions()
public com.konakart.appif.StockReservationOptionsIf getStockReservationOptions()
public int getNumberOfItems()
public com.konakart.appif.BasketIf[] updateBasketWithStockInfo(com.konakart.appif.BasketIf[] basketItems) throws com.konakart.app.KKException
basketItems
- the basketItemscom.konakart.app.KKException
- an unexpected KKException exceptionpublic com.konakart.appif.BasketIf[] reserveStock(com.konakart.appif.BasketIf[] basketItems) throws com.konakart.app.KKException
basketItems
- the basketItemscom.konakart.app.KKException
- an unexpected KKException exceptionpublic void setBasketTotal(java.math.BigDecimal basketTotal)
basketTotal
- the basketTotal to setCopyright © 2018 DS Data Systems UK Ltd.