|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.paneris.melati.shopping.ShoppingTrolley
org.paneris.melati.shopping.DefaultShoppingTrolley
public class DefaultShoppingTrolley
A Shopping Trolley stores information in the user's Shopping Trolley.
It does this by storing itself in the session.
For this reason, the constructors are private, and you will be expected always to get the Shopping Trolley using getInstance();
usage example: ShoppingTrolley trolley = ShoppingTrolley.getInstance(Melati melati); context.put("trolley", trolley);
| Field Summary |
|---|
| Fields inherited from class org.paneris.melati.shopping.ShoppingTrolley |
|---|
address, config, country, county, email, hasDetails, locale, melati, message, name, postcode, tel, town, VAT_PERCENT_TIMES_TEN |
| Constructor Summary | |
|---|---|
DefaultShoppingTrolley()
|
|
| Method Summary | |
|---|---|
void |
assertLogin(org.melati.Melati melatiIn)
Do something to force users to login. |
void |
confirmPayment(org.melati.Melati melatiIn)
A call back point for the payment server. |
double |
getDeliveryValue()
You need to provide some mechanism for calculating the delivery value for the order (item delivery values are calculated individually. |
double |
getDiscountRate()
If you want to apply a discount to this order, do it here. |
java.util.Locale |
getLocale()
Set the Locale for this trolley. |
boolean |
hasDelivery()
Provide a mechanism for working out if this order should include a delivery charge. |
boolean |
hasDiscount()
Provide a mechanism for working out if this order should include a discount. |
boolean |
hasVAT()
Provide a mechanism for working out whether this order should include VAT (default should be true). |
void |
load(java.lang.Integer id)
Load a trolley from something persistent. |
void |
save()
Save a trolley to something persistent. |
void |
setDefaultDetails(org.melati.Melati melati)
Set the user's detault details into this trolley. |
| Methods inherited from class org.paneris.melati.shopping.ShoppingTrolley |
|---|
abandonURL, addItem, baseURL, configureRequest, confirmURL, detailsURL, displayCurrency, displayCurrency, getCountry, getCounty, getDeliveryAddress, getDeliveryDisplay, getDiscountRateDisplay, getDiscountValue, getDiscountValueDisplay, getEmail, getInstance, getItem, getItems, getMessage, getName, getPostcode, getTel, getTotalDeliveryValue, getTotalValue, getTotalValueDisplay, getTotalValuePence, getTown, getValue, getValueDisplay, getVATDisplay, getVATValue, hasDetails, initialise, initialise, isEmpty, name, newItem, newTrolley, paidURL, remove, removeItem, roundTo2dp, setCountry, setCounty, setDeliveryAddress, setEmail, setFromForm, setLocale, setMessage, setName, setPostcode, setTel, setTown, updateURL, viewURL |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultShoppingTrolley()
| Method Detail |
|---|
public java.util.Locale getLocale()
getLocale in class ShoppingTrolleypublic void load(java.lang.Integer id)
load in class ShoppingTrolleypublic void save()
save in class ShoppingTrolleypublic void setDefaultDetails(org.melati.Melati melati)
setDefaultDetails in class ShoppingTrolleypublic void assertLogin(org.melati.Melati melatiIn)
assertLogin in class ShoppingTrolleypublic boolean hasDelivery()
hasDelivery in class ShoppingTrolleypublic double getDeliveryValue()
getDeliveryValue in class ShoppingTrolleypublic boolean hasDiscount()
hasDiscount in class ShoppingTrolleypublic double getDiscountRate()
getDiscountRate in class ShoppingTrolleypublic boolean hasVAT()
hasVAT in class ShoppingTrolleypublic void confirmPayment(org.melati.Melati melatiIn)
confirmPayment in class ShoppingTrolley
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||