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

Creating a basket

Let us create our shopping basket in stages, starting with basic functionality, and then extending it as we go along to support all of the considerations we have discussed.

When to build a user's basket

Our shopping basket will probably be stored on most pages, so we need to ensure that we can build up the contents of a shopping basket regardless of where a user is within the site being powered by our framework. Obviously, we may not always want to have this available, but more often than not, we would. Another consideration is with regards to user authentication: if the visitor is a logged-in user, then the basket will be built in a different way, so we need to ensure we build the basket after any authentication processing is ...

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