ZMObject
└─ZMCheckoutHelper
public class ZMCheckoutHelper
extends ZMObject
| Constant Summary | |
|---|---|
| final static str | |
| final static str | |
| final static str | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | __construct(ZMShoppingCart shoppingCart) Create new instance. |
| 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 | Check if the given shopping cart qualifies for free shipping (as per free shipping ot). |
| boolean | isGVOnly() Checks if there are only gift vouchers in the cart. |
| boolean | Check for virtual cart. |
| void | Mark cart as free shipping. |
| boolean | Check whether the cart is ready for checkout or not. |
| void | Save the cart hash as reference against tampering. |
| string | validateCheckout(boolean messages) Validate the current checkout request. |
| boolean | verifyHash(ZMRequest request) Validate the cart hash. |
| int | Checks for virtual products in the cart. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public final static str CART_PRODUCT_QUANTITY = 'quantity'
public final static str CART_PRODUCT_STATUS = 'status'
public final static str CART_PRODUCT_UNITS = 'units'
public void __construct(ZMShoppingCart shoppingCart)
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 isFreeShipping()
Check if the given shopping cart qualifies for free shipping (as per free shipping ot).
true if the cart qualifies 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 void markCartFreeShipping()
Mark cart as free shipping.
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 void saveHash(ZMRequest request)
Save the cart hash as reference against tampering.
public string validateCheckout(boolean messages)
Validate the current checkout request.
true.null if everything is ok.public boolean verifyHash(ZMRequest request)
Validate the cart hash.
true if, and only if, the session cart hash and the current hash are the same.public int virtualProductsCount()
Checks for virtual products in the cart.
Checkout helper.