How to Create a Shopping Cart

If you sell products online through a website, you need a shopping cart to make it easy for buyers to pay you. A shopping cart is a program that allows the buyer to select products; it also calculates tax and shipping charges, if appropriate, processes payment and records shipping and billing addresses. Shopping carts are so common that many buyers won't bother dealing with a website that doesn't have one.


  1. Image titled Create a Shopping Cart Step 1
    Obtain a merchant account either through your bank or an online merchant service. Both will charge a number of fees in order to process the buyers' credit card charges and deposit the money into your checking account.
  2. Image titled Create a Shopping Cart Step 2
    Check with your web hosting company to see if it offers a shopping cart free of charge or for a small monthly fee. If so, you can can add it to your website with a few clicks of your mouse.
    • The hosting company will provide you with instructions on how to do this, as well as a means to access your shopping cart directly to get reports, including total sales per month and sales taxes collected.
  3. Image titled Create a Shopping Cart Step 3
    Use Paypal's shopping cart. Paypal is trusted by most online buyers and if you add its shopping cart to your site, Paypal handles your transactions for a small fee. If you use Paypal, you do not have to get your own merchant account to accept credit cards.
  4. Image titled Create a Shopping Cart Step 4
    Take advantage of open source software to get a free shopping cart you can add to your site. Open source software is developed in a collaborative manner, and anyone can download it for their own use. An open source shopping cart comes with documentation and technical support, making it as easy to use as shopping carts you pay for.
  5. Image titled Create a Shopping Cart Step 5
    Buy software that will help you install a shopping cart on your website. You will be able to customize your cart and add features as needed when your business grows. The price of shopping cart software ranges from about $65 to more than $200.
  6. Image titled Create a Shopping Cart Step 6
    Program your own shopping cart if you're able to, using Hypertext Preprocessor and Structured Query Language. This is usually too complex a task unless you're a professional web designer.


  • You may be able to make additional sales by inviting your buyers to create user accounts on your website and then save items in their carts to return and purchase at another time.
  • The more your shopping cart acts like a real shopping cart, the more comfortable your buyers will be. They should be able to "drop" items into the cart, see a list of what's in their cart, have the option to remove an item, and see the total cost of all items in the cart before checking out.


  • Be sure that you comply with the law when collecting sales tax for your products. You will be required to collect tax for in-state buyers, report the sales to the state and forward the taxes collected to the state treasurer. Obtaining a business license is the first step toward properly reporting sales tax.

Article Info

Categories: Web Programming