
Shopkeeper is a module for creating an online store on
CMS MODX . In this article I will tell you what's new in Shopkeeper 3.0, what new features and what are the differences from the previous version. But first, a little history.
History of creation
The first version of Shopkeeper was released more than 5 years ago, in 2009. Then there was a lack of a solution to create an online store for MODX. Shopkeeper was not the first, but was not quite a bad demand. Until now, someone uses it on MODX Evolution, although the latest version for this platform was released in 2011. Then SHK 2.x was released for MODX Revolution. For Revo, the first was the
VisionCart component, but I didn’t immediately like it with the confusing interface. Its development seems to have stalled back in 2011. Soon after, the worthy components of online stores came out for Shopkeeper and it's nice to know that all this was released by Russian developers. Now is the time for Shopkeeper 3.
')
What's new in Shopkeeper 3

The interface is created using
Bootstrap and
AngularJS . Of course, crossing these tools with
ExtJS , which is used in
MODX Revo , may seem overkill, but they get along quite well. After I tried
AngularJS , I didn't want to use anything else at all. Moreover, this once again proves the versatility of MODX. I think you will not be disappointed with this decision.
In the component configuration, you can now set not only order statuses, but also currency rates, fields in the order table, order contact information, delivery methods and payment methods.

For delivery, you can specify the amount of the order at which the delivery becomes free. For each order status, you can specify your letter template to the user; if you leave the field blank, the letter will not be sent.
There is a section "Statistics". So far it only shows statistics on the number of orders by months, but it is planned to expand it.

This is how editing an order:

Snippets and Plugins
Shopkeeper snippet in the site template now needs to be called like this:
[[!Shopkeeper3@cart_catalog]]
cart_catalog - The name of the parameter set.
It is recommended to specify all parameters in the parameter set, since you need to synchronize these parameters when Ajax request.
You can display two or more baskets on the same page. In the system settings, you need to list all used parameter sets for SHK (“shk3.property_sets” parameter), and in the basket chunk for the wrapping element, add the “data-shopcart” attribute with the parameter set number. This number will be updated basket.
Example of a basket basket chunk <div class="shop-cart" data-shopcart="1"> <div class="shop-cart-head"><b></b></div> <div class="empty"> <div class="shop-cart-empty"></div> </div> </div> <div class="shop-cart" data-shopcart="1"> <div class="shop-cart-head"><a name="shopCart"></a><b></b></div> <div class="full"> <form action="[[+this_page_url]]#shopCart" method="post"> <fieldset> <div style="text-align:right;"> <a href="[[+empty_url]]" id="shk_butEmptyCart"> </a> </div> <table width="100%"> <colgroup> <col width="25%" /> <col width="40%" /> <col width="25%" /> <col width="10%" /> </colgroup> <tbody> [[+inner]] </tbody> </table> <div style="text-align:right;"> : [[+delivery_name]] ([[+delivery_price]] [[+currency]]) </div> <div style="text-align:right;"> : <b>[[+price_total]]</b> [[+currency]] </div> <noscript> <div><input type="submit" name="shk_recount" value="" /></div> </noscript> <div class="cart-order"> <a href="[[+order_page_url]]" id="shk_butOrder"> </a> </div> </fieldset> </form> </div> </div>
As in version 2.x, a chunk consists of two parts with a special separator.
The first part is the empty basket of goods.
The second part is the basket chunk with goods.
Optional additions are ready for use:
shkOptions - a new snippet for the Shopkeeper configuration output. For example, you can display a list of shipping and payment methods.
hk_fihook is a
FormIt hook that is used to send letters after
placing an order.
num_format - modifier snippet for separating price numbers into discharges.
shk_curr_rate - modifier snippet for displaying prices at the rate if the store uses multicurrency.
shk_contextSwitch - plugin for automatic context switching.
shk_updateInventory - plugin to account for the number of goods in stock.
shk_multicurrency - plugin for recalculating prices when changing currency.
For more information, see the documentation that is always included ("/core/components/shopkeeper3/docs/readme.txt").
Rewritten
shopkeeper.js and
shopkeeper.class.php , but the differences in functionality are not significant.
How to upgrade from Shopkeeper 2.x to 3.0
Sample list of update actions:
- Make a backup copy of the site (files and databases).
- Manually remove snippets and plugins in the Shopkeeper category (from the old version). The component itself is not necessary to delete.
- Install SHK 3 and update Shopkeeper snippet calls in templates.
- Create parameter sets for the snippet. Make settings in accordance with the new documentation.
- Edit cart chunks, add the attribute "data-shopcart".
- Customize new plugins if used.
- If the delivery methods output is used, update in accordance with the new documentation (“shkOptions” snippet).
- If you created your snippets or plugins and used a call to the SHK tables in the database, you need to change the package and object names in the code.
The tables in the database are not compatible, so the order history during the transition from the old version will be lost. Migrator yet.
Currently available version of
Shopkeeper 3.0rc5 .
Component in the MODX repository:
http://modx.com/extras/package/shopkeeper3Project site:
http://modx-shopkeeper.ru/Support Forum:
http://modx-shopkeeper.ru/forum/Source code:
https://bitbucket.org/andchir/shopkeeper-3Demo site:
http://demo.modx-shopkeeper.ru/ (in development, not everything that is planned works)