ZMObject
|
+--ZMShoppingCarts
public class ZMShoppingCarts
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
Create new instance. |
|
| Method Summary | |
|---|---|
| protected float | calculateAttributePrice(ZMShoppingCartItem item) Calculate the attribute price for the given item. |
| protected float | calculateOneTimeCharge(ZMShoppingCartItem item) Calculate optional one time charges. |
| protected float | calculateProductPrice(ZMShoppingCartItem item) Calculate the product price for the given item. |
| void | clearCart(ZMShoppingCart cart) Clear a cart. |
| static void | instance() Get instance. |
| ZMShoppingCart | loadCartForAccountId(int accountId) Load and populate a cart. |
| void | saveCart(ZMShoppingCart cart) Save the cart content. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public ZMShoppingCarts()
Create new instance. /
protected float calculateAttributePrice(ZMShoppingCartItem item)
Calculate the attribute price for the given item.
protected float calculateOneTimeCharge(ZMShoppingCartItem item)
Calculate optional one time charges.
protected float calculateProductPrice(ZMShoppingCartItem item)
Calculate the product price for the given item.
public void clearCart(ZMShoppingCart cart)
Clear a cart.
This will remove all database entries and session data.
public static void instance()
Get instance. /
public ZMShoppingCart loadCartForAccountId(int accountId)
Load and populate a cart.
public void saveCart(ZMShoppingCart cart)
Save the cart content.
Shopping cart service.
NOTE1: This is work in progress (as are ZMShoppingCart and ZMShoppingCartItem). Eventually I also hope to work around the fact that basket attributes and items are associated by the customers_id rather than the basket id. Right now it is not possible to have more than one cart per customer (if possible, this could be used as wishlist storage by adding a type...)
NOTE2: This service does not use the session to cache any values. Two more queries compared to much more complex code do currently not seem worth the effort.