I have redone an installation of Shopkeeper and then setup a sample store. Notably, I think I kept half-decent notes and here they are, albeit a bit rough to read. The order in which I created things is not the same as in the demo. To my mind, this ordering seemed to make a bit more sense.
Please advise of errors, improvements, etc.
Hope this helps,
MattC
====== GET SOME SAMPLE IMAGES ==============================
Go to
http://wdevblog.net.ru/shopkeeper
or
http://www.kunane.com/modx/shopkeeper.html
and save the images of products to use as test material. I’m going to use three.
====== CREATE AN ORDER FORM DOCUMENT =======================
Name this
Order Form
with an alias of
orderform
Make sure it is *not* checked for being shown in the menu. Make sure it is published and is not using the rich text editor. Assign it to a new category, for example "shopkeeper". For a template, I used the minimal template provided with MODx. Save it, noting it’s document ID.
Return to editting this document. For it’s content enter the following :
[!Shopkeeper? &lang=`en` ¤cy=`USD` orderFormPage=`[*id*]`&gotoid=`AB` &changePrice=`1`&counterField=`1`!]
[!eForm? &formid=`shopOrderForm`&tpl=`shopOrderForm`&report=`shopOrderReport`&vericode=`1`&ccsender=`1`&gotoid=`AB`&subject=`SHK order`&eFormOnBeforeMailSent=`populateOrderData`&eFormOnMailSent=`sendOrderToManager`!]
(If you’re cutting and pasting, watch out for the carriage returns)
Save the document.
(After we create the thank you page, we will return here and replace AB with the document id of that page.)
====== CREATE A THANK YOU DOCUMENT =========================
Do the same thing for a "Thank You" page as was done for the Order Form page. "Thank you" is the title and the alias is thankyou. It should not be visible in the menu and it should be published. Assign it to the shopkeeper category.
Enter the following for the time being in its content area :
<p><strong>Thank you for your order! </strong></p>
<p>We'll be in touch shortly...</p>
Save the document, noting it’s document ID. Return to editing the content of the order form page and update the AB values with this number.
====== CREATE TEMPLATE PAGE(S) FOR THE PRODUCTS ============
Create a new template which will serve as the page template for each product :
Elements -> Manage Elements -> Templates
Select New Template
OR
Duplicate an existing template. In either case, give it a unique name and assign it to the new category, which we’ve called here "shopkeeper". (The purpose of the category is to help keep things
organized). Obviously, different types of products can have different types of templates. But for each, we will want a link to the shopping cart. So add this to each page’s content, perhaps
in the header or footer or a sidebar :
[!Shopkeeper? &lang=`en` ¤cy=`USD` &cartType=`small` &orderFormPage=`XY`&gotoid=`AB`!]
where XY is the document ID of the order form page created above and AB is the document ID of the thank you page created above.
Below the content tag add this line :
This will enable us to have an "Add to Cart" button on the product page itself.
FWIW, the styling for the cart may be found in the file
style.css
in the shopkeeper folder
(For example changing the margin from 10px 0 to 10px 10px
on line 17 narrows the cart box.)
======= CREATE TEMPLATE VARIABLES FOR THE PRODUCT PAGES ===========
Now, back in the Manager view, go to
Resource -> Manage resources -> Template variables
Select
New template variable
name it
price
with input type being Number, and associating it with the template(s) created above
under "Template Access" Also, select "shopkeeper" for its category. Save this variable.
Do the same for a template variable named
image
Under caption, put
image
and select as an input type
Image
Also, assign it to the template(s) created above and use "shopkeeper" as a category. Save the variable.
========== CREATE A PAGE TO SHOW A SUMMARY OF PRODUCTS =========
Create a new document. It too can be associated with a template, but we’ll want to have it’s contents
be a Ditto call. In the template you select, place this call somewhere (e.g. top of the sidebar)
[!Shopkeeper? &lang=`en` ¤cy=`USD` &cartType=`small` &orderFormPage=`XY`&gotoid=`AB`!]
in order to see the cart.
For a title, I used "Catalog Page" and for an alias I entered "catalog" Now, select the Page Settings
tab and make sure that the "Published" button is selected and that it is marked as a container. You may also want to turn off the rich text editor. Place the following call call in it’s content area :
[!Ditto? &parents=`[*id*]`&tpl=`shopStuff`!]
Save the document
========= CREATE PAGES FOR EACH PRODUCT ===============
Right click on the "Catalog Page" document and select
Create resource here.
In the "General" tab of the form that opens up, give the new document the title
Mouse
and create an alias such as "mouse." (I used images from the Russian demo site)
In the Summary/introtext box, type some text, such
as:
Computer Mouse "Mickey Mouse" - the best gift to the system administrator!
Now, in the document content box - and using the TinyMCE editor - select Insert image. A dialogue box will come up and you will need to browse for the image you downloaded, upload it to the image folder, then select it. In the next dialogue box, select "Insert". Don’t bother with a description.
In the same content box, underneath the image, enter more descriptive text.
At the bottom of the page, under template variables,select "insert" next to the image variable and select
the same photo as uploaded above.
Also add a price.
Go to the "Page Settings" tab and make sure the document
is published.
Save the item.
Repeat the above steps for the Keyboard and Mousepad.
========== CREATE THE SHOPKEEPER MGMT MODULE =================
Returning to the manager, select
Modules -> Manage Modules
and then
"New Module"
Name the module
Shopkeeper
and give it a short description.
For it’s code, copy the contents of the
Shopkeeper_module.php
file found in the main folder into the Module code
box.
Assign it to the shop category.
Save the module.
Refresh the manager page and "Shopkeeper" should now show up as a selection under the "Modules" section.
Click on the button to the left of the Shopkeeper entry and select Run module. At this point, select install. (One will see a refresh and configuration option, with no orders present.)
====================== CREATE CHUNKS ==================
Using the text provided in the install/examples/en folder
create the chunks, assigning them to the shopkeeper category.
====================== CREATE SNIPPETS ================
Using the text provided in the install folder, create
the two snippets - Shopkeeper and SHKwidget - assigning
them to the shopkeeper category as well.
====================== Test Drive =====================
If mail is enabled, one should by now be able to preview
the catalog page, select a product, and submit
an order. Incorrectly entering the confirmation code
should generate a short two line error message below
the shopping cart. Correctly entering the code
should bring up the thank you page.)
Now return to the Shopkeeper module under the Modules
page of the manager view.
Selecting refresh should show the orders so far received.
We’ll tackle adding the widget later...