The O3 Shopping Cart
Introduction | Settings | Containers
Introduction
O3's shopping cart - as you'd expect - allows user to store quantities of products ready for purchase. It also allows the customer to select a delivery option for the cart.
You can build a compare list container for products in the cart, and with the Types module - you can also have your product features in there for comparison.
If you have the List Items module - the cart will store those items too. (In this case the cart is more like a 'Favorites' list.)
A checkout button for the cart can be created using the create_checkout_button(provider, text, image) function (see Functions. The cart contents are added into the sales table once the transaction has completed successfully, and the IPN has been received from the provider. At this point the cart's status is changed from 'Active' to 'Inactive'.
Settings
Under 'General ECommerce': Cart Empty Text - defines the text to show when the cart is empty.
Under 'PayPal', 'StormPay' etc...: Add To cart, View Cart & Checkout buttons text and images.
Under 'List Items': Cart Text & Images subsection.
Cart & Compare Containers
The cart containers define how the cart is displayed. It can be anything from a simple list of names & quantities you want to appear in a sider, or the complete details ready for checkout.
Carts can contain a special #LINE# symbol which defines how an order line is displayed within the container. If the cart container doesn't contain the #LINE# symbol, the line macros do not get parsed.
The following macros are valid in Cart containers:
Cart Container Macros
| Macro | Is Replaced By |
| Order Line Macros |
| #LINE# | This delimits the order line HTML
|
| IT-NAME | The Item / Product Name
|
| IT-TITLE | The Item / Product Title
|
| IT-DESC | The Item / Product Description
|
| IT-IMAGE | The Item / Product Image
|
| IT-URL | The Item / Product URL
|
| IT-QTY | The Item / Product Quantity
|
| IT-SNH | The Product Shipping & Handling Charge
|
| IT-OP1-N | The Product Option 1 Name
|
| IT-OP2-N | The Product Option 2 Name
|
| IT-OP1-V | The Product Option 1 Value
|
| IT-OP2-V | The Product Option 2 Value
|
| IT-REMOVEform# | Remove item from basket button (form)
|
| IT-CHANGE-QTYform# | Change quantity form. Includes the current quantity.
|
| Order Header (Cart) Macros |
| CA-PRSUBTOT | The Line Subtotal Minus S&H
|
| CA-SUBTOT | The Line Subtotal
|
| CA-ID | The Cart ID
|
| CA-PRODUCT | The Product Name
|
| CA-ITEM | The Item Name
|
CA-TOTPR
| The Total Number Of Products
|
CA-TOTSNH
| The Total Shipping & Handling
|
CA-TOTPR
| The Total Number Of Items
|
CA-TOTQTY
| The Total Quantity
|
CA-TOTAL
| The Total Price
|
CA-CHECKOUTprovider|text|image#
| A checkout button for the specified provider (defaults to iKobo) with the optional text & image.
|
CA-EMPTYform#
| An 'Empty Cart' button (form)
|
| TITLES | A list of all the Type data descriptions, for all items in the cart. This can be quite a long list! It's intended to be used to dynamically generate the titles for a compare list
|
| TYPEDATA | A list of all the Type data values, for all items - in the same order as the TITLES
|
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3USR# | Any value from the current user's data or type data (i.e. O3USRus_email#)
|
| SHOW-FORMform# | Display the (mandatory) form. Used for remove/change qty etc.
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
Example Compare Container
<table width='100%'>
<tr><th>Property</th>TITLES<th>TITLE</th>#</tr>
#LINE#
<tr>
<th><a href='IT-URL' title='IT-NAME'>O3VARit_title#</a></th>
TYPEDATA<td>DATA</td>#
</tr>
#LINE#
</table>
|
Example Cart Container
<table width='100%'>
<tr><th >image</th><th>Item</th><th>Price</th><th>Qty</th><th>Total</th></tr>
#LINE#
<tr>
<th><a href='IT-URL' title='IT-TITLE'><img src='img/O3VARit_image#'></a></th>
<td>IT-NAME</td>
<td>£IT-PRICE</td>
<td>IT-QTY</td>
<td>£IT-SUBTOT</td>
</tr>
#LINE#
<tr>
<td> </td>
<td>CA-TOTPR</td>
<td> </td>
<td>CA-TOTQTY</td>
<td>£CA-TOTAL</td>
</tr>
</table>
|
|