ZMObject
|
+--ZMCheckoutHelper
public class ZMCheckoutHelper
extends ZMObject
| Field Summary | |
|---|---|
| final mixed | |
| final mixed | |
| final mixed | |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMCheckoutHelper(ZMShoppingCart cart) Create new instance. |
|
| Method Summary | |
|---|---|
| array | Check whether the cart is ready for checkout or not. |
| boolean | checkStock(boolean messages) Check stock. |
| int | Checks for free products in the cart. |
| int | Checks for free shipping. |
| boolean | isGVOnly() Checks if there are only gift vouchers in the cart. |
| boolean | Check for virtual cart. |
| boolean | Check whether the cart is ready for checkout or not. |
| string | validateCheckout(boolean messages) Validate the current checkout request. |
| int | Checks for virtual products in the cart. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public final mixed CART_PRODUCT_QUANTITY = 'quantity'
public final mixed CART_PRODUCT_STATUS = 'status'
public final mixed CART_PRODUCT_UNITS = 'units'
public ZMCheckoutHelper(ZMShoppingCart cart)
Create new instance.
public array checkCartStatus()
Check whether the cart is ready for checkout or not.
Possible return values:
public boolean checkStock(boolean messages)
Check stock.
true.true if the stock check was sucessful (or disabled).public int freeProductsCount()
Checks for free products in the cart.
public int freeShippingCount()
Checks for free shipping.
public boolean isGVOnly()
Checks if there are only gift vouchers in the cart.
true if only vouchers are in the cart.public boolean isVirtual()
Check for virtual cart.
NOTE: In contrast to Zen Cart, we treat the always free shipping
product attribute as boolean. That means currently there is no support for
the special case where virtual products do require a shipping address.
true if the cart is purely virtual.public boolean readyForCheckout()
Check whether the cart is ready for checkout or not.
NOTE: The main difference to the Zen Cart implementation of this method is that no error messages are generated. This is left to the controller to handle.
true if the cart is ready or checkout, false if not.public string validateCheckout(boolean messages)
Validate the current checkout request.
true.null
* if everything is ok.public int virtualProductsCount()
Checks for virtual products in the cart.
Checkout helper.