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

Shopping basket preparation

Although we won't be developing our shopping basket until Chapter 6, let us have a brief think about the consequences of customizable products.

Stock control

With product variations, stock control becomes an interesting issue. If we only had a single set of variations for each products (as we discussed under the Simple variants section, earlier in the chapter), we could simply disable an option if it was out of stock. However, with multiple variations we may have small blue t-shirts, but not large blue t-shirts. The logic for detecting if this is in stock obviously lies with the shopping basket itself: when we click on Add to basket, it will need to detect to see if there are any in stock.

This obviously isn't an ideal ...

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