Shopping Cart Extension
This is an extension for getting started with a simple shopping cart.
In this extension, orders are submitted via email. Check out the Stripe extension for an example of integrating a payment gateway with this cart.
These instructions are based around a completely blank project as a starting point. If you are integrating cart.js into an existing site, feel free to skip/modify these steps as necesary.
- Upload cart.js to your extension folder
- Change the email address at the top of cart.js to whatever email you want to send the orders to (a comma separated list of emails works as well)
- Upload "layouts/cart.tpl" and "layouts/index.tpl" to your layouts folder
- Create a cart folder in your templates folder and upload "cart/index.tpl" and "cart/_current_items.tpl" to it.
- Create a store folder in your templates folder and upload "store/index.tpl" and "store/product.tpl" to it
- Create a new section called "Store" and assign it to "store/index.tpl"
- Add some entries to the "Store" section with a single line text field named "price", give the entries a price that looks like "5.99", assign the entries to "store/product.tpl"
- Replace your index.tpl with the "/index.tpl" in this repo, or just this adds a simple link to your store wheverever it is fitting.
Now you're good to go and should be able to view the items in your store, add them to your cart and order them through the checkout process.
A Starting Point
The cart.js extension is meant as a starting point, not a finished shopping cart.
You will need a payment processing provider to handle credit card payments on your site. Check out the Stripe extension for an example of how to do that.