Handel::Constants - Common constants used in Handel
use Handel::Constants qw(:cart); my $cart = Handel::Cart->create({ shopper => 'D597DEED-5B9F-11D1-8DD2-00AA004ABD5E' }); if ($cart->type == CART_TYPE_SAVED) { print 'This cart is saved!'; };
Handel::Constants contains a set of constants used throughout Handel. It may be useful (or even a good idea) to use these in your code. :-)
By default, Handel::Constants export nothing. You can use the export tags below to export all or only certain groups of constants.
Converts a string version of a constant into that constants value.
print str_to_const('CART_TYPE_SAVED'); ## prints 1
All items in the saved cart will be appended to the list of items in the current cart. No effort will be made to merge items with the same SKU and duplicates will be left as separate items.
If an item with the same SKU exists in both the current cart and the saved cart, the quantity of each will be added together and applied to the same sku in the current cart. Any price differences are ignored and we assume that the price in the current cart is more up to date.
All items in the current cart will be deleted before the saved cart is restored into it. This is the default if no mode is specified.
Marks the cart as permanent. Carts with this value set should never be automatically reaped from the database during cleanup.
Any cart with this type could be purged from the database during cleanup at any time.
The phase run when first creating a new order.
The phase run to validate address, shipping, and other information about an order.
The phase run when authorizing or validating credit card or other payment information.
The phase to run and post authorization order cleanup, like setting order number, before order delivery/confirmation.
The phase run to deliver the order request to the vendor and/or customer.
Contains the default set of phases run automatically. This is currently, VALIDATE, AUTHORIZE, and DELIVER.
Contains all available phases.
All plugin handlers returned successfully and the checkout process has completed.
One or more plugin handlers returned an error or the checkout process aborted with errors.
Specifies that the plugin handler sub has completed its work without errors.
Specifies that the plugin handler sub has opted not to perform any work. If your plugin is going to decline, please add a message to the current context using "add_handler" in Handel::Checkout
Specifies that the plugin handler encountered errors and would like to abort the checkout process.
Marks the order as permanent. Order with this value set should never be automatically reaped from the database during cleanup.
Any order with this type could be purged from the database during cleanup at any time.
The following %EXPORT_TAGS are defined for Handel::Constants. See Exporter for further details on using export tags.
%EXPORT_TAGS
This exports all constants found in this module.
This exports all CART_* constants in this module.
CART_*
This exports all CHECKOUT_* constants in this module.
CHECKOUT_*
This exports all ORDER_* constants in this module.
ORDER_*
Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/
To install Handel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Handel
CPAN shell
perl -MCPAN -e shell install Handel
For more information on module installation, please visit the detailed CPAN module installation guide.