I've revised the code presented in this post after a reader pointed out the (seemingly obvious, but I never saw it) flaw in my code. It's always important to have someone checking your code occasionally. Special thanks to Tim Bond for pointing out this error.
Tip #6 - Adding Items to your Basket
The basic funtionality of the LineItem class has changed little from Commerce Server 2002 and adding an item to your basket works pretty much as it did in the previous version.

The first thing to do is create a new LineItem instance, set the required and optional (weakly-typed) properties and then add the LineItem to the OrderForm's LineItemCollection.
As with every action taken in the Basket, you should always update the Basket and run the appropriate pipeline as shown here.

In Commerce Server 2007, it's also important to remember to dispose of the PipeLineInfo object to ensure that resources are released in a timely manner. Also, since Commerce Server 2007 now supports multiple "named" baskets that are active at the same time, you may need to extend your code to accommodate this new feature.