Shopping cart

The shopping cart page can be used to display (to the customer) which products he or she has ordered and the total price / vat of those products. It can also be used to select an shipping method, in which case a separate shipping page is unnecessary. The customer can be offered to change the content of his shopping cart by adjusting quantities of products or removing products entirely. The customer might also fill in an discount code if such an action exists. All these possible features are controlled by the myShop extensions and are available in the custom layout for the shopping cart.

Basket

One of the most important parts of the shopping cart is the basket. The myShop extension for it is myshop-repeat:basket, and it works much like a productlist, but with a few differences. The extensions which can be used within the basket are fixed, and do not include displaying any of the product information directly from the spreadsheet (which is usual for any normal productlist). The fixed information for each product which can be displayed is limited to:

Controlling quantity and contents

The following inputs / actions can be used for each line of the basket contents, to control the products in it and the quantity of those products.

Changing quantity

For changing the quantity, there are three methods available:

Removing products

The action myshop-action:remove-product removes all quantities of the product on that line.

Totals

The shopping basket can also display the vat-totals and total price for all products in the basket. The information which can be displayed is:

Navigation

The navigational actions available within the shopping basket are:

  • myshop-action:continue-shopping
    This action takes the customer back to where he came from in the shop.
  • myshop-action:help-basket
    This action pops up a window with some information for the customer on how to use the shopping cart.
  • myshop-action:next-page
    This action takes the users to the next page of the ordering procedure.

Special discounts

All actions (or discounts) which are defined in the editor can be shown with the myshop-repeat:action-list extension. This extension will loop over all actions and allow you to display these actions. The extensions which can be used within this loop are:

An action can require coupon codes, so the user needs a way to add these codes to the action list. The extension myshop-control:coupon-code can be used to display a input box which the customer can use. When this box contains a valid coupon code (set in the editor) the action for that code will be added to the shopping cart when the next-page action is executed.

Related products

It is also possible to show a list of related products in the shopping basket. This is done by using the myshop-repeat:related-products extension. See the related-products page for more information.

Example

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <title>Example of a simple shopping basket</title>
        </head>
        <body>
                <table style="myshop-has:products" cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tr>
                                <td align="center">
                                        <table width="98%" cellpadding="0" cellspacing="0" bgcolor="#ffffff" border="0">
                                                <tr>
                                                        <td colspan="7">&nbsp;</td>
                                                </tr>
                                                <!-- Basket header -->
                                                <tr>
                                                        <td style="font-weight:bold">Artikel</td>
                                                        <td style="font-weight:bold">Omschrijving</td>
                                                        <td style="font-weight:bold">Aantal</td>
                                                        <td align="right" style="font-weight:bold">Prijs</td>
                                                        <td align="right" style="font-weight:bold">Totaal</td>
                                                        <td>&nbsp;</td>
                                                </tr>
                                                <!-- Product list -->
                                                <tr style="myshop-repeat:basket">
                                                        <td style="myshop-value:product-id">product number</td>
                                                        <td style="myshop-value:description">description</td>
                                                        <td style="myshop-value:quantity">quantity</td>
                                                        <td align="right" style="myshop-value:price-formatted">price</td>
                                                        <td align="right" style="myshop-value:price-line-total-formatted">price</td>
                                                        <td align="right"><a style="myshop-action:change-product">wijzigen</a></td>
                                                        <td align="right"><a style="myshop-action:remove-product">verwijder</a></td>
                                                </tr>
                                                <tr>
                                                        <td colspan="7">&nbsp;</td>
                                                </tr>
                                                <!-- Shipping selection -->
                                                <tr style="myshop-has:shipping-selection">
                                                        <td colspan="3">&nbsp;</td>
                                                        <td style="font-weight:bold;myshop-action:shipping-selection" align="right">&nbsp;</td>
                                                        <td align="right" style="font-weight:bold;myshop-value:price-shipping-formatted">0,00</td>
                                                        <td colspan="2">&nbsp;</td>
                                                </tr>
                                                <!-- VAT list -->
                                                <tr style="myshop-repeat:vat-list">
                                                        <td colspan="3">&nbsp;</td>
                                                        <td><span style="myshop-value:vat-percentage"/> BTW van <span style="myshop-value:vat-from-price-formatted"/></td>
                                                        <td align="right" style="myshop-value:price-vat-formatted">vat</td>
                                                        <td colspan="2">&nbsp;</td>
                                                </tr>
                                                <!-- Total price including vat -->
                                                <tr>
                                                        <td colspan="3">&nbsp;</td>
                                                        <td style="font-weight:bold">Totaal</td>
                                                        <td align="right" style="font-weight:bold;myshop-value:price-total-formatted">0,00</td>
                                                        <td colspan="2">&nbsp;</td>
                                                </tr>
                                        </table>
                                </td>
                        </tr>
                        <tr>
                                <td align="center">
                                        <span style="myshop-has:continue-shopping">
                                                <a style="myshop-action:continue-shopping">Continue shopping</a>
                                        </span>&nbsp;
                                        <a style="myshop-action:help-basket">Help</a>
                                        <a style="myshop-action:next-page">Next</a>
                                </td>
                        </tr>
                        <tr>
                                <td><span style="myshop-value:remarks"/></td>
                        </tr>
                        <tr style="myshop-has:terms-conditions">
                                <td>
                                        <a style=myshop-action:terms-conditions">Terms and conditions</a>
                                </td>
                        </tr>
                </table>
        </body>
</html>

Overview applicable extensions

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment