Displaying the basket on every page
Most e-commerce websites display a small shopping basket on each page, often at the top of the page or the side of the page, reminding the customer how many products are in their basket, the cost of the contents of their basket, and providing a link for them to view their basket in detail and checkout their order.
To display the basket on each page we will need:
- An empty basket template file, so that if the customer has no products in the basket, the page accurately reflects that with a suitable message.
- A basket template file, which displays the number of products in the customer's basket, the cost of the order, and a link allowing the customer to proceed to the checkout process.
- A template tag in our main templates, ...