How to add a shopping cart to WordPress

Shopping cart

Here’s a great way to add a shopping cart to your WordPress blog so you can sell products directly from your site without the user having to go to an external site. If you offer products for sale on your blog, it’s much nicer for your customers to stay on the same site that they see the products on.

This plugin is simple and powerful, it uses AJAX for some parts of it and it seems to work just dandily on the blog I have installed it on. Here’s how you do it…

[expert instructions]
Download plugin, upload to plugins directory, activate it.
Visit the ecommerce tab and set options for country and currency, edit categories, edit checkout options, edit gateway options, add products.
[/ expert instructions]

[Hand hold instructions]
First, get yourself a copy of the WP Shopping Cart plugin and upload it to your plugins directory, go to you plugins page and activate it :

wp shopping cart plugin activate

You should see a new tab at the top of the dashboard labeled ‘ecommerce’ . Click that and we can set up the options for our country and tax rate. Just select your country from the pull down box and it should set the tax rate for you.

You can also require someone to be registered before they can purchase products. This is up to you, for now, you can leave it as ‘no’. The only problem with requiring a user to register first is the non-immediate way in which WordPress allocates a password to a user by emailing it to them. Also, once someone logs in to your site, they get presented with the dashboard and not the site but there’s a great plugin to use to beat that here.

Leave the URL settins for now, they’ll work just find and dandy as they are (they may look different on your setup if you have a different permalink structure)

Choose your language and keep the theme as default:

shop options

Next, you need to choose your cart location. I use the setting as a widget because this blog is widget enabled. You can choose to add it manually yourself by inserting the code to anywhere on your sidebar if widgets aren’t your thing.

Choose which options you want and be sure to choose the correct currency setting for your country:

shop options2

The next section asks you if you want to charge shipping, if you are selling physical products then you need to choose ‘yes’ and set the base shipping charges. (base charges are standard and only added once regardless of how many products are added to the cart, you can add additional delivery charges on the product settings) :

shop options3

Click ‘submit’ and that’s one page done!

Now to edit category and products…Click on the ‘categories’ tab for ecommerce and then on ‘edit’ next to the example category and put in your own options and click ‘edit category’ when you are done:
Category options

Now, add your products!
Click on the ‘products’ tab and choose the category you want to add products to from the pull down box. Just add the options you want..Product Name:
Additional Description:
Choose the categories for the product by ticking the boxes for each category:
Choose a brand if you are using one:
Enter the price of the product you are selling:
Product Options

The next option is stock control, if you are selling physical products then you can tick the box for ‘limited items’ and it will give you a field for putting how many items of this you have, once you run out the software wont show this product any more until you get more stock and edit the amount here.

Variation control is a way to add options to a product, like size for a t-shirt or a colour choice which will be selectable on the product description page before a customer adds the product to the shopping cart.

Additional shipping costs can be added so that each item that is added to the cart will also add that amount to the shipping (good for heavy items)

Product images are self explanatory and always a good idea to use a decent picture for your product, the plugin does a good job of creating a thumbnail and uses AJAX to display the full size image when a customer clicks it. (choose your thumbnail size or upload a seperate thumbnail if you want)

Product download is for digital items.

Click ‘add product’ to save your product settings:

Product Options2

If you don’t want tax added to each item or it is already included in the price then select the option to ‘do not include tax’.

Payment options. You need some way to allow payments right? this shopping cart only gives you the option to receive money by Paypal, the customer can use their paypal balance or a credit card to purchase your products and the money will be received into your paypal account.First, go to the ‘payment gateway’ tab and select ‘paypal’ from the pull down box, you’ll presented with a screen to add your details.Enter your paypal email address:
Paypal IPN is the paypal instant payment notification, if you’re selling physical products then you probably wont need this.
Paypal accepted currency is what your paypal account is set up for.
Forms: just use the pull down boxes to select the correct fields for each title (use the top set of options on the pull down boxes):
Gateway options

Checkout options: This is the last screen you have to edit, the default is set to ask the customer to input their cardholder address and shipping address but I think it’s better to just use the cardholder address (for anti-fraud purposes).To remove the shipping details fields, just click the trash can icon on the side of each field to remove it, you can add other fields too like a text area for added delivery instructions etc. I make sure that the ‘mandatory’ option is selected for the postal code too.Choose the option for ‘paypal/credit card only’ if you don’t plan on letting your customers pay manually by check or other option:
Checkout options

That’s the settings done, now we have to add the widget and perhaps don’t display certain pages that were added by the plugin to your tabs or ‘pages’ list..You can add the shopping cart by visiting ‘presentation/widgets’ and dragging the cart button to wherever you want:
Widget optionsIf you have noticed the extra pages being displayed on your blog and you don’t want them, simply change the template code for the page list display options. You will need to know the post id of each of these pages so click on ‘manage/pages’ to see a list and note down their respective id’s and use an ‘exclude’ option in your template wherever there is a ‘wp_list_pages’ function. eg:

wp_list_pages('exclude=4,5,6' ); 

That’s it! you should now have a products page showing your products and when someone clicks ‘add to cart’ , it will AJAX it over to the shopping cart ready to be checked out:
product added

Once ‘checkout’ is pressed, the customer is presented with the screen to add their address details:


Once that is filled in, they click ‘make purchase’ and will be sent to the paypal login page where they can use their paypal account or pay by credit card if they don’t have an account already:

paypal screen

You will be able to see a record of what purchases have been made on the first tab of the ‘ecommerce’ section:

Purchase log

There you go! This is just a quick and dirty way to get a shopping cart on your blog, you can play around with lots of options to your hearts content if you have many products or want to offer digital downloads. There’s even a widget to add a donation button to your blog and have that go in the shopping cart.Personally, I like this way of selling on your blog and have used this (edited) plugin on a commissioned site using a very simple (and very edited) WordPress 2.3 theme, the customer loved it!

0 thoughts on “How to add a shopping cart to WordPress

  1. SmockLady

    Andy, how confident are you at customizing this plugin and one of it’s addons? And what would you charge? I have this plugin-the main plugin works great and I do like it; I’ve installed it on four blogs for various people, but one of it’s addons is not working the way the developers said it would and they are extremely slow to help and do not return my e-mails for days on end. I guess I am going to have to go around them. Also what would you recommend for reading or hand-holding so I can learn to do tweak it myself? I’m smart and have done a good bit of blog customization so I think I am quite capable of learning.

    SmockLady’s last blog post..The FeedReader vs. the Sexy Blogroll

  2. Andy Bailey

    @diana: let me know when you find something to sell, I’ll plug it on here!

    @smocklady: I could always give it a bash! I have just got a wordpress install working on my windows machine at work so it’s easy to test things when I’m developing plugins and themes.
    it’s not too hard editing php, it’s a little bit complex with someones elses code that uses a lot of include files.
    never say never though! if you want me to take a look it, which plugin are you talking about?

  3. Jalaj

    A nice plugin by the developer, and equally nice explanation of it’s feature by you over here. Since I would not be able to check it out practically, can you please elaborate if a customer checked out to paypal and instead of completing payment, backs. Will the ‘ecommerce’ section show it as purchase or not.

    Jalaj’s last blog post..The Blog Revisited – 3

  4. Andy Bailey

    glad you like it charleyboy! I see that the comment whore is back on your blog, it’s a great game to play to encourage comments and thanks for using CommentLuv!

  5. Andy Bailey

    I thought it might be nice to add a cart here and sell the last bits of hardware that are still in stock for my company.
    exam? what’s that for?

    I think a cart would be nice for cross promotion on a personal blog, people that visit there would be good customers!

  6. Opal Tribble

    Hey Andy!
    I’m back in school working on my Masters in Traditional Naturopathy. :-) I keep busy.

    I believe you are correct quite a few people have already asked me when was I going to start selling some of my products on my natural healing website. I’ll most likely add this before the year is out and I’ll be sure to give you a plug when I do. ;-)

    Opal Tribble’s last blog post..Vegan Chili: Comfort Food On A Chilly Day

  7. Andy Bailey

    good luck with your exam, I’m sure you’ll do well and I look forward to seeing some products on your site!

    I’ll give it a go here too and see how it goes, I want to get a new design in first though. I’ve had a quote for 500USD to do it and I’m waiting on some other quotes so it might be a few weeks yet….

  8. Graham

    This is a great plugin , this is a great tutorial , ive been developing a site around this plugin for a few months now – only a few steps to go before people can buy.
    Just a note for people to hold back a little on D-loading beta 2 … a more refined beta 3 is on its way (i’m told) . Keep plugin

  9. Jeff Kwiat

    Thanks for the tutorial! I’m on WP 2.3.1 and WP e-commerce 3.6 Beta 3, and I have almost everything set up. The one problem I’m running into is when I try to “Make Purchase”, I am sent to the Paypal home page asking me to login into my account, and not to the Paypal screen you mention above…I used my personal email account and not my client’s merchant account in the Gateway Options, but I’m wondering if that’s the issue, or if I have something else screwed up. Any advice you can give me would be very much appreciated


  10. Elaine

    Hi! I have a question, I just downloaded the e-commerce plugin and I’m trying to follow the instructions. I’m getting lost as to how to include the “add to cart” button next to my items on my pages?

    Can that be done from this plugin?

  11. Andy Bailey

    there should be an add to cart on the product displayed on the product pages, if you are writing a post about it, you can copy the html from the products button and put that on your post.
    hope this helps

  12. John Humphrey

    Hi Andy,
    I have this plug-in set up on my small company website using paypal. Everything works fine apart from one piece. How do I reference my company’s standard terms and conditions?
    I initially just put some text into the box in the shop options page – but that didn’t work. All that happens (you can try for yourself on the site if you have a minute) is that the terms and conditions link on the verify order page pulls up a window into my wordpress directory! I then thought maybe I should put a link to a document into the box on the options page – but same result.
    I’m not a programmer at all so trying to track back through the various style sheets and php scripts to try and find the link to modify is beyond me. Any pointers you can give would be great.
    BTW This is the first site I’ve found that actually has some real help for novices like me trying to set this up.
    Thanks, John

    John Humphrey’s last blog post..Baxall Vivid DVRs For Sale

  13. Elaine

    Thanks Andy! That’s a good idea. I will need to add the “add to cart” button myself to all my posts. I wonder if there’s any version that would do it for me though?

    I tried it but I linked it to the products page….any ideas on how to find the link of the button itself?


  14. Pingback:

  15. Arpit Tambi

    Hi Andy

    A nice post here, I would suggest you to increase the keyword density in this article and submit it to various social bookmarking services.

    Can you please post an article on how to change the email text that is being sent to the buyer when a purchase is made?

    This will surely help us bloggers… :)

  16. Elaine


    It’s been working good except I tried listing a product category to one of my post on wordpress. On the FAQ sheet it said to enter the [wpsc_category=1] on the post. I edited with category id number but i’m getting an error when I try to view it. Any ideas?


  17. Andy Bailey

    Elaine » hi elaine, you would be better off visiting the developers site and seeing if they can help, this tutorial was intented to just get someone started with a shopping cart, all support queries should go to instinct who make the product.

  18. Jeff

    I am looking to customize my shopping cart a little more then the basic options in the plug-in options area. I am trying to find any documentation on modifying the cart. If you have any suggestions I would extremely thankful for the advice.

    Jeff’s last blog post..Site Under Construction

  19. Andy Bailey

    I think it’s good enough out of the box, if you’re after customization I think it would be cheaper and easier to have a design made for one of the open source carts and link to that from your blog. I say this because if you’re using Google Checkout and Adwords, you can’t have a Google checkout icon showing next to your ads unless you are selling from a site just for ecommerce. they wont put one on if you’re selling from your blog

  20. Jeff

    Thanks for the quick response.

    I would really like to put this plug-in to work for myself. I am currently using the cart manually in my sidebar. I want to tweak the style of the cart. I have been looking through the code for hours and I just can’t seem to find the cart files. I’ve tweak the grid view and I’ve done a few other hacks to the plug-in. I’ve already put in quite a bit of time. If you have any suggestions they would be much appreciated. Especially considering the fact that the designers forum has been down for the better part of the last few days.

    Jeff’s last blog post..Site Under Construction

  21. Andy Bailey

    I think the cart doesn’t have it’s own file and is generated ‘on the fly’ by the code. It is capable of having it’s appearance changed within the style sheet though (I think!)

  22. Elaine


    I uploaded the latest version so when I’m editing a product I’m trying to add a variation set but then there’s section to fill out under Stock – Price – Associate with File(Tick one). Doesn’t this mean to fill out the price for each variation? I think I’m not doing it correctly. Any advice?


  23. Andy Bailey

    sorry elaine, I have since stopped using it because it started misbehaving when I tried to edit stock items and I couldn’t get a reply from support so I now use a different cart system.
    you would be better off speaking to the developers

    [edit] it turns out that I sent my support request to the wrong address! doh!
    Dan at instinct has since contacted me and his support team have been able to really help with my issues with it, they are logging into my site to see what the issue is and hopefully will have it resolved soon.

    thanks DAN!

  24. Andy Bailey

    I use e-junkie on here now, it gives you a free AJAX shopping cart that works quite well (see the bottom of this post). You have to set up each add to cart button for each product but it seems to work quite well.

    I have gone for the 5USD a month subscription which allows you to use their site and put your product details on there including stock levels etc.

    I have successfully sold a few products through their cart and I’m happy with the functionality and it’s all I need for a few products. On the commercial site that I was using the plugin for I decided it would be better to have an entirely separate site for the cart done in the same template. This way I can have the google checkout icon showing next to adwords because it is a standalone ecommerce site.

    the e-commerce plugin is still being used on the original site though as it keeps the look of the blog all the way through to the payment gateway page which looks more professional.

  25. Nate

    I just installed the wp shopping cart e-commerce (3.6 beta) on my wordpress and am having a strange problem.

    Despite whatever option I’ve chosen in my store options, the product pages are not displaying “add to cart” button. It only displays “buy now” which, upon clicking is non-functional and takes the user back to the home page. I’ve gotten it to display “add to cart” once on a complete fluke, but could never get it to display again after that.

    Any clue why this is happening??

    Nate’s last blog post..Protected: Steve Mehler

  26. Andy Bailey

    I can’t think of what it could be. My only advice would be to uninstall it, remove the pages and then go back through the whole install process one step at a time. I’ve had to do this with other cart programs and it sometimes works!

  27. jeff


    I know that you are using a new plug-in but I also know that a few other e-comm users are still checking in on your site. I’ve got a new issue all of a sudden. I have spent a while adding items and now I want to turn my site loose on the world. No matter what I do people can’t see any of my items unless they register on my blog and are the status of “editor”. I’m sure I’ve just spent too long looking at my own work. I’m just wondering if someone else has had a similar issue. The site is

    I have the gold cart with grid-view. Thanks for your help in advance.


    jeff’s last blog post..Site Under Construction

  28. Monsieur Personne doudou et poupée design

    Your tutorial is really great and i really appreciated to find such detailed explanations.
    Everything runs fine for me excepted when i try to display products (here is an example ) I really don’t know what’s going on. I tried to re-install as you mentioned but it didn’t change anything. I also tried to desactivate other plugins and de-activated permalinks but the results is always the same.
    I would really appreciate if you could help me a little bit.

    Best regards,


    Monsieur Personne doudou et poupée design’s last blog post..La famille s?agrandit

  29. Elaine


    Each time they do a new version it fixes the old problems I’ve had.

    I thought I had seem somewhere that you can place the shopping basket in a post or page. I was trying to look through the instructions but I couldn’t find anything. Is there a way to do this so you can view your shopping basket when you’re on a page?


  30. Andy Bailey

    poupee: it looks as though the cart software has had an error and stopped outputting any content, that’s why you page doesn’t finish loading. Have a look at your products and see if there are any errors in the images. it could possibly be the character set of your blog, maybe it’s not recognizing the characters you have used to describe the product and instead of throwing a mysql error, it just dies…

    elaine: sorry I don’t know, I just put the cart on the sidebar with a widget so it’s always visible on every page

  31. Simon


    Awesome plugin, but can it be adapted to take credit cards directly, thus avoiding Paypal? Is it secure enough to just add the field boxes for card details?

    Cheers Buddy!

  32. Andy Bailey

    Simon: for that you would need a special gateway payment script, if you wanted to take credit card numbers on the page, you would need an SSL page for protection of the details. If you have paypal pro then you can accept credit cards directly from paypal without the customer having to have a paypal account (you can do that already with paypal but it takes an extra click from the customer)

  33. orphea

    Am I the only person having MAJOR trouble with this plugin? I follow all of the instructions and my “products page” is empty other than saying [productspage] – just like that. WHYYY :( HELP!

  34. orphea

    Also, I guess I have a newer version than what is mentioned on this page, as several of the options I do NOT have, such as, requiring registration to purchase, which I would like to have.

  35. orphea

    Someone up above mentions a “Faq Sheet” .. faq sheet, what faq sheet? My download did NOT come with a faq sheet. :|

  36. Andrej


    I need to do following:
    When person enters its data (name, address, e-mail,…) I need an e-mail to be sent to me, so that I know that the person ordered the product. This e-mail should contain data of customer and data of products he/she ordered. I am not using paypal or credit card. I just need to know who ordered what. Then I make phone call to that person, confirm it and send it through post office.

    Can you help me?

  37. jyoti

    I m using own created theme and have added shopping cart to it but cart is not visible, i think its because that i dont have widget available, Should i install widget to make visible my shopping cart. I need that shopping cart should be visible at some image click i.e. m having a image of “order” when user clicks on it the shopping cart should be visible.
    Any suggestions will be appreciated

  38. Elpie

    This is a very nice, easy to follow tutorial.
    I had been trialling this plugin and encountering loads of problems. With no response from the developers I have uninstalled and am currently looking for an alternative.
    Has anyone used the YAK plugin?

  39. Pingback: 16 Resources To Give Readers Their Own Edge - Day 6 of 7 Days to Making Your Blog Blossom » Personal Edge Insights - Barbara Ling

  40. Market Theme

    Hi guys…

    Another shopping cart solution you might be interested in is the Market theme. There is an online demo you can try out.

    It operates as a WordPress theme that has the shopping cart system built-in.

    Just upload the theme, activate it, enter your Paypal email address into the settings area, and you’re ready to add products.

    There is also a backend product manager plugin included in the download package to use to add or edit your products.

    I hope this helps.

    Market Theme´s last blog post..Get Market for Free

  41. Ricky

    I need help, i have uploaded the wp-shopping cart plugin but on the plugins screen i go to activate it and all i get is an http internal error 500

    please help

  42. Robert Eckert

    Thanks for informing me about the various ecommerce shopping carts out there.It has been very helpful to my research and here is what,I came up with over the past few days.

    There are different types of ecommerce shopping cart available in the market for small as well as large businesses. Whatever business you are running, you must pick a top slot ecommerce shopping cart to boost up your online sale transactions.

    The top ecommerce shopping cart for your online shop should be such that it is easily customized with your website. It must incorporate attractive design and shape to your webpages displaying the product range.

    Ecommerce shopping cart provides complete business solution to all your online business websites. The main features of the top shopping carts include complete user control.

    When a web designer or developer starts working on a website, he requires complete control over the whole process. So the whole process has to be user friendly. The software must be such that it is able to manage your site completely. The software must not give unnecessary problems to the user.

    The software must be designed to be compatible to the changes. The designer must be able to include new innovations to his web pages. The layout design must be compatible to the site and the software must provide for these provisions. There should be a provision for products’ image uploads, change in prices, and inclusion of descriptive texts and many other things.

    The most vital element that all top ecommerce shopping cart software should take note of is the security. When an online buyer wants to buy a product, he enters all his financial details in to the website. The softwares should be so designed that they provide complete protection to the buyers. The customer’s personal details should remain a secret at all times.

    No third party should be able to access it.In this age and time of advanced technology, many changes are being incorporated into these ecommerce shopping carts. This helps in attracting more and more buyers to your website. Many sites are coming up with the well designed schemes to sell their shopping cart software.

  43. Serena Carcasole

    Thank you for the info! I have been researching on shoppingcarts and am certified with 1shoppingcart through practice pay solutions however 1shoppingcart is very expensive. I have not used the wordpress shoppingcart as of yet but will try it and look forward to using it!

    Thanks again

    Serena Carcasole
    Your 1STOP Business Service Shop
    Outsource your way to success.

    Serena Carcasole´s last blog post..Simple, free Advertising!