Dancer::Plugin::Interchange6 - Interchange6 Shop Plugin for Dancer
Version 0.121
This Dancer plugin is now DEPRECATED since all new development has moved to the Dancer2 plugin Dancer2::Plugin::Interchange6.
All Interchange6 Dancer applications need to use the Dancer::Session::DBIC engine.
The easiest way to configure this is in your main module, just after all the use statements:
use
set session => 'DBIC'; set session_options => {schema => schema};
Available configuration options:
plugins: Interchange6: cart_class: MyApp::Cart carts_var_name: some_other_var
cart_class
If you wish to subclass the cart you can have "shop_cart" return your subclassed cart instead. You set the cart class via cart_class. Defaults to Dancer::Plugin::Interchange6::Cart.
carts_var_name
The plugin caches carts in a "var" in Dancer and the name of the var used can be set via carts_var_name. Defaults to ic6_carts.
ic6_carts
You can use the Dancer::Plugin::Interchange6::Routes plugin bundled with this plugin to setup standard routes for:
To enable these routes, you put the shop_setup_routes keyword at the end of your main module:
shop_setup_routes
package MyShop; use Dancer ':syntax'; use Dancer::Plugin::Interchange6; use Dancer::Plugin::Interchange6::Routes; get '/shop' => sub { ... }; ... shop_setup_routes; true;
Please refer to Dancer::Plugin::Interchange6::Routes for configuration options and further information.
Returns Dancer::Plugin::Interchange6::Cart object.
Creates payment order and authorizes amount.
Calls "redirect" in Interchange6::Schema::ResultSet::UriRedirect with given args.
Returns Interchange6::Schema object.
Accessors for Interchange6::Schema result classes. You can use it to retrieve a single object or the corresponding result set.
shop_product('F0001')->uri; shop_navigation->search({type => 'manufacturer', active => 1});
Available accessors are shop_address, shop_attribute, shop_country, shop_message, shop_navigation, shop_order, shop_product, shop_state and shop_user.
shop_address
shop_attribute
shop_country
shop_message
shop_navigation
shop_order
shop_product
shop_state
shop_user
This plugin installs the following hooks:
The functions registered for these hooks receive the cart object and the item to be added as parameters.
Triggered before item is validated for adding to the cart.
Triggered before item is added to the cart.
Triggered after item is added to the cart. Used by DBI backend to save item to the database.
The functions registered for these hooks receive the cart object, the current item in the cart and the updated item.
Triggered before cart item is updated (changing quantity).
Triggered after cart item is updated (changing quantity). Used by DBI backend to update item to the database.
Triggered before item is validated for removal. Receives cart object and item SKU.
Triggered before item is removed from the cart. Receives cart object and item.
Triggered after item is removed from the cart. Used by DBI backend to delete item from the database. Receives cart object and item.
Triggered before cart is cleared.
Triggered after cart is cleared.
The functions registered for these hooks receive the cart object, the old name and the new name.
Triggered before cart is renamed.
Triggered after cart is renamed.
Triggered before users_id is set for the cart.
Triggered after users_id is set for the cart.
Triggered before sessions_id is set for the cart.
Triggered after sessions_id is set for the cart.
This command expires/manages DBIC sessions and carts. NOTE: For proper functionality please copy/link to Dancer App/bin directory.
interchange6-expire-sessions
The Dancer developers and community for their great application framework and for their quick and competent support.
Peter Mottram for his patches.
Copyright 2010-2016 Stefan Hornburg (Racke).
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Dancer2::Plugin::Interchange6
Interchange6, Interchange6::Schema
To install Dancer::Plugin::Interchange6, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::Interchange6
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::Interchange6
For more information on module installation, please visit the detailed CPAN module installation guide.