O'Reilly logo

PHP 5 e-commerce Development by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required