Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Ajax shooping cart
Each product would be an object and you would store each product the user has added into an array (in JSON format). So if you have an add product button on each product, the chosen product would be pushed to an array and then asynchronously posted to the server where your PHP code can parse it out and store it in a database.
At the same time, the user's shopping cart is using AJAX to read that JSON file and show the user what he currently has on his shopping cart.