|
NAMEDancer2::Plugin::Interchange6 - Interchange6 Shop Plugin for Dancer2VERSIONVersion 0.204REQUIREMENTSAll Interchange6 Dancer2 applications need to use the Dancer2::Session::DBIC engine.The easiest way to configure this is in your "config.yml" (or whatever other configuration file you prefer): plugins DBIC: default: schema_class: Interchange6::Schema # ... other DBIC plugin config here engines: session: DBIC: db_connection_name: default # connection name from DBIC plugin session: DBIC CONFIGURATIONAvailable configuration options:plugins: Interchange6: cart_class: MyApp::Cart carts_var_name: some_other_var
ROUTESYou can use the Dancer2::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: package MyShop; use Dancer2; use Dancer2::Plugin::Interchange6; use Dancer2::Plugin::Interchange6::Routes; get '/shop' => sub { ... }; ... shop_setup_routes; true; Please refer to Dancer2::Plugin::Interchange6::Routes for configuration options and further information. KEYWORDSshop_cartReturns Dancer2::Plugin::Interchange6::Cart object.shop_chargeCreates payment order and authorizes amount.shop_redirectCalls "redirect" in Interchange6::Schema::ResultSet::UriRedirect with given args.shop_schemaReturns Interchange6::Schema object.shop_...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:
HOOKSThis plugin installs the following hooks:Add to cartThe functions registered for these hooks receive the cart object and the item to be added as parameters.
Update cartThe functions registered for these hooks receive the cart object, the current item in the cart and the updated item.
Remove from cartThe functions registered for these hooks receive the cart object and the item to be added as parameters.
Clear cart
Rename cartThe functions registered for these hooks receive the cart object, the old name and the new name.
EXPIRE DBIC SESSIONSThis command expires/manages DBIC sessions and carts. NOTE: For proper functionality please copy/link to Dancer2 App/bin directory.interchange6-expire-sessions ACKNOWLEDGEMENTSThe Dancer2 developers and community for their great application framework and for their quick and competent support.Peter Mottram for his patches and conversion of this plugin to Dancer2. LICENSE AND COPYRIGHTCopyright 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. SEE ALSOInterchange6, Interchange6::Schema
Visit the GSP FreeBSD Man Page Interface. |