12. E – Commerce Website Tutorial – Display the PHP Shopping Cart

www.developphp.com In this 12th video we will make our custom PHP cart look like an actual online shopping cart by statically designing it first, then making it dynamic. The E – Commerce Web Site we will be assembling is one in which all of the inventory is in a MySQL database and we offer a custom PHP cart for a unique shopping experience.


  • Thanks Adam!!!
    I wonder if you will include the shipment price at the end, depending on how many products the customer buys. I think that would be a little tricky.
    Or maybe that could be handle at the paypal side.

  • I wonder if adam can make something like a input field of how many you want and it will add that amount to the cart.

  • adam i know i am going back a bit here but seeing the cart table i wanted to make my product list display in a table row too i have tried to copy the same format as you did for the cart but i am getting an error where the }else{ tag is for the you have no products listed where have i gone wrong ? i will post at develop php incase anyone can help me

  • @adam i got it working by just removing the }else{ and the comment but its only showing one product now so maybe i will have to go back to the old system 🙁 which is a shame as it looks good

  • hey adam, on the product page that shows the detail of the product, how could we have a text box with a default value of 1 but when you change it to 2 it adds 2 items to the cart instead of the user having to click on the “add to cart button” twice?

  • also another thing, is there a way in the admin section to add amount in stock so that a customer cant order 10 and you only have 5?

  • How do i display all the production on one pag like i do on web intersect with member search and the user a way to filter the bata with pagination

  • will there be a spot on the admin panel that allows the manager to add how many are in stock, so that way people dont buy 5 and there is only 1, and when its out of stock it echos out a message that says out of stock or something? i think this would be a good feature.

  • adam is there away to stop the client refreshing the page as when you refresh the cart it adds another item into the cart can we put a header tag into it ? header(“location:cart.php”);
    ? or would this also add another product ?

  • everything works fine if you paid attention to the code, the only bug that I see is when you add a new item to the car, and when at the cart.php you refresh the page it will add the item again. how can you fix that. it tried adding a header(“location: cart.php”); and exit(); but it will go infinity looping

  • @marloncastrillo i put this on section 1 code at the end and it works
    }//close foreach loop

  • can you make a quantity drop down menu on the items detail page so you dont have to go back to home to add more than one

  • @ngshane – Yay! Somebody is actually listening and learning to build their own code from what they got from the previous lessons. That is what this is all about. We are not spoon feeding people a polished perfect application, instead we are making tutorials about how to program apps yourself.

  • Thanks for the great video! If you need help installing, configuring, or setting up zen cart, check out our channel for lots of Easy Help Zen Cart Tutorials:

Leave a Reply

Your email address will not be published. Required fields are marked *