Business::Cart::Generic::Database::Order - Basic shopping cart
See Business::Cart::Generic.
Business::Cart::Generic implements parts of osCommerce and PrestaShop in Perl.
This class extends Business::Cart::Generic::Database::Base.
new() is called as my($obj) = Business::Cart::Generic::Database::Order -> new(k1 => v1, k2 => v2, ...).
new()
my($obj) = Business::Cart::Generic::Database::Order -> new(k1 => v1, k2 => v2, ...)
It returns a new object of type Business::Cart::Generic::Database::Order. See Business::Cart::Generic::Database.
Business::Cart::Generic::Database::Order
Key-value pairs accepted in the parameter list:
Takes an object of type Business::Cart::Generic::Database.
This key => value pair is mandatory.
Takes a DBIx::Class schema object.
This value is provided by the parent, Business::Cart::Generic::Database::Base.
These keys are also getter-type methods.
Add an item to the cart.
$order is a hashref returned by Business::Cart::Generic::Util::Validator.
Returns the order hashref from the session object.
This latter hashref is discussed in the FAQ in Business::Cart::Generic. The code is in "reset_order()" in Business::Cart::Generic::Database.
Cancel the order whose id is in the order hashref in the session object.
Returns nothing.
Wrap up the order by calculating quantities on hand per item, and updating the order history.
Get order item objects from the orders table.
These items are of type DBIx::Class::Row.
Limit defaults to {}, and can be used to get 1 order by - e.g. - setting it to {'me.id' => $order_id}.
The orders table is joined with these tables:
I.e. the street_addresses table.
$order is of type DBIx::Class::Row.
Returns a hashref with these keys:
This is a hashref with these keys:
The values are all strings.
This is a string like '2011-05-10 10:48:53'.
This is the order's primary key in the orders table.
This is an array ref of item hashrefs, with these keys:
This is the currency's primary key in the currencies table.
This is a string from the products table.
This is the item's primary key in the items table.
This is a float from the products table.
This is the product's primary key in the products table.
This is an integer from the items table.
This is a string from the order_statuses table.
This is a string from the payment_methods table.
This is a sum over all items.
Remove an item from the cart.
$order_id is the primary key in the orders table.
$item_id is the primary key in the items table.
Called by add_to_cart().
Returns the primary key in the items table of the newly-inserted item.
The file CHANGES was converted into Changelog.ini by Module::Metadata::Changes.
Version numbers < 1.00 represent development versions. From 1.00 up, they are production versions.
Many thanks are due to the people who chose to make osCommerce and PrestaShop, Zen Cart, etc, Open Source.
Email the author, or log a bug on RT:
https://rt.cpan.org/Public/Dist/Display.html?Name=Business::Cart::Generic.
Business::Cart::Generic was written by Ron Savage <ron@savage.net.au> in 2011.
Home page: http://savage.net.au/index.html.
Australian copyright (c) 2011, Ron Savage.
All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html
To install Business::Cart::Generic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::Cart::Generic
CPAN shell
perl -MCPAN -e shell install Business::Cart::Generic
For more information on module installation, please visit the detailed CPAN module installation guide.