Fix add to cart bug.

Fixes #514.
Merge pull request #573 from garyc40/pr-514

Fix add to cart bug.