WordPress 2.9 e-Commerce
Build a proficient online store to sell products
and services
Brian Bondari
BIRMINGHAM - MUMBAI
WordPress 2.9 e-Commerce
Copyright © 2010 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2010
Production Reference: 1220210
Published by Packt Publishing Ltd.
32 Lincoln Road Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847198-50-1
www.packtpub.com
Cover Image by Vinayak Chittar ()
Credits
Author
Brian Bondari
Reviewers
Dan Milward
Editorial Team Leader
Akshara Aware
Project Team Leader
Lata Basantani
Taeke Reijenga
Project Coordinator
Acquisition Editor
Joel Goveya
Usha Iyer
Proofreader
Development Editor
Joel T. Johnson
Rakesh Shejwal
Production Coordinator
Technical Editors
Shradha Vichare
Dayan Hyames
Krithika Sabareeshwar
Hithesh Uchil
Indexer
Monica Ajmera Mehta
Cover Work
Shradha Vichare
About the Author
Brian Bondari is a musician, composer, and teacher with equal loves for both
music and technology. His hobbies include reading, hiking, composing music, and
playing with his pet rabbit. He also spends an exorbitant amount of time lying on the
floor grading papers.
Brian earned his doctorate from the University of Kansas in 2009, and is currently an
Assistant Professor of Music Theory and Composition at the University of Texas at
Tyler. When he is not writing music or grading papers, he serves as Senior Editor for
the multi-author technology blog, .
You can also visit him at .
There are many people I would like to thank for their help and
support while writing this book. First of all, many thanks to Dan
Milward and the team at Instinct for their hard work in developing
the WordPress e-Commerce plugin, without which this book would
not have been possible.
Also, thanks to Usha Iyer, Rakesh Shejwal, Joel Goveya, and other
members of Packt Publishing for their help and support during the
organization, writing, and editing processes. Additional thanks go to
Taeke Reijenga for his work in reviewing the book.
Finally, utmost thanks to my wife Katrina for her unending love,
support, and patience.
About the Reviewers
Dan Milward is a 31-year-old self-taught entrepreneur living in Wellington, New
Zealand. He enjoys working with WordPress and making games for mobile phones.
His earliest "happy" childhood memories are of playing computer games on his
Commodore 64/128. If not for the relaxed attitude of his parents around computers
and games, then perhaps the WP e-Commerce plugin would never have been made.
Dan and his team have been contributing to the WordPress ecosystem in one
way or another for the best part of 6 years, mostly through their work developing
WordPress plugins, most notably the world-famous WordPress e-Commerce plugin,
which has had over 500,000 downloads.
His company Instinct has an office in Wellington where they focus on making
WordPress plugins, and investors in Tokyo where the focus is on user-generated
games for mobile phones.
Many people around the world have contributed to the WP e-Commerce plugin but
none have contributed as much as Thomas Howard and Jeffry Ghazally. These guys
are the real stars behind the WordPress e-Commerce plugin.
I'd like to thank Amber for going easy on me and allowing me to
work on this book during "family time". I'd like to thank Jane Wells
and Matt Mullenweg from Automattic for all the moral support that
they have provided us over the years, and I'd like to thank all the
parents out there who allowed their children to play on computers
in the 90s. Those children are today's developers and our peers in the
WordPress community.
Thank you.
Taeke Reijenga is the co-founder of Level Level, a web design agency from
Rotterdam, Netherlands. Level Level focuses on custom WordPress design and
development for businesses. Amongst numerous WordPress-based projects are
several e-commerce sites build with WP e-Commerce. One of them offers over
100,000 products.
In his spare time, Taeke loves to cook and enjoy a good glass of wine.
You can contact Taeke via
Table of Contents
1
8
8
8
9
9
9
10
15
10
11
12
14
16
17
18
20
20
21
23
23
24
25
26
26
27
28
Table of Contents
29
31
32
33
33
36
37
39
41
41
42
42
43
44
45
45
46
46
46
48
49
50
50
51
52
52
53
54
56
60
63
61
62
62
63
64
64
64
65
66
66
67
[ ii ]
Table of Contents
68
70
72
72
73
75
76
76
79
80
81
85
86
87
88
89
92
93
93
93
94
95
96
97
97
97
98
98
98
98
99
99
100
101
103
104
109
110
[ iii ]
104
106
Table of Contents
113
139
114
114
115
116
117
118
119
120
121
121
121
122
123
124
125
127
128
129
131
133
134
135
137
140
141
142
143
144
146
147
149
149
150
152
154
155
156
157
[ iv ]
Table of Contents
159
159
160
161
161
162
163
164
164
164
165
165
166
166
166
168
169
170
171
172
174
175
177
179
181
182
182
182
183
184
186
187
189
189
190
191
191
194
194
[v]
Table of Contents
196
196
197
198
199
200
200
201
203
203
204
205
205
206
208
209
210
210
210
212
214
214
215
Basic WordPress Simple PayPal Shopping Cart setup and usage
218
218
218
219
219
222
223
223
[ vi ]
216
221
225
226
230
231
232
232
234
Table of Contents
235
235
238
238
235
237
237
241
251
259
[ vii ]
242
243
246
246
247
248
248
249
252
254
254
255
256
257
Preface
So, did you decide to build an e-commerce site using WordPress as the foundation?
Wonderful! You've made the choice that more and more people are discovering:
that WordPress is capable of far more than just building a great blog. With the
extensibility provided by third-party plugins, it can handle almost any task,
including powering a growing e-commerce site.
By pairing WordPress with the free WordPress e-Commerce plugin, you can easily
create a powerful online store capable of selling a variety of goods, including digital
products with automated downloads. It is an ideal combination for hobbyists and
small businesses alike. If you have ever dreamed of running your own online shop,
or want to add an e-commerce element to an existing physical store, this book is
for you.
While installing WordPress and the (WordPress) WP e-Commerce plugin
are relatively simple tasks, the work does not stop there. There is still a lot of
information that you need to know, and there is plenty to learn about the installation,
configuration, payment setup, security, and even design elements. We are going to
cover a lot of ground in this book, and by the time we get to the end, you should
have a fully functional, powerful, and secure online store at your disposal.
Let's get started, shall we?
What this book covers
Chapter 1, Getting Started with WordPress and e-Commerce, provides an introduction
to WordPress and the WP e-Commerce plugin, both of which will power our new
online store.
Chapter 2, Getting Ready to Sell, covers all of the basics of installation and a feature
overview. It also covers the essentials of transforming your WordPress installation
from a blog into a business-ready platform.
Preface
Chapter 3, Configure Your e-Commerce Settings, offers a step-by-step walkthrough
of all the settings for the WP e-Commerce plugin and lays a solid foundation for
creating a catalog of products.
Chapter 4, Managing Your Product Catalog, builds upon the preparation done in
Chapter 3 and shows you all of the steps necessary to build a product catalog of both
physical goods and digital downloads.
Chapter 5, User Accounts: Customers and Staff, offers insight into how WordPress
handles multiple users and their roles in our upcoming online store, including
options related to user registration.
Chapter 6, Checkout and Payment Setup, covers the most important element of any
online store: getting paid. This chapter provides details on available payment
gateways and offers a step-by-step tutorial on setting up both PayPal Standard and
Google Checkout.
Chapter 7, Shipping, Taxes, and Processing Orders, explores the myriad of options
available for getting your product out the door and to the customer.
Chapter 8, Themes and Design Elements, provides an overview of customizations with
regard to appearance. Topics covered include shortcodes, a CSS overview, and the
WP e-Commerce theme engine.
Chapter 9, Deploy, Secure, and Maintain Your Shop, shows you how to move from the
testing platform to a production server, including watching for any pitfalls that can
happen along the way.
Chapter 10, Alternative e-Commerce Plugins, explores a range of other plugins that also
offer e-Commerce functionality in conjunction with WordPress.
Chapter 11, Marketing Your Shop, covers a final, but essential, aspect of running any
e-commerce site: ways to make your site known to the world and bring customers
through your virtual doors.
Appendix A, Gold Cart Module Extendibility, offers a view of available upgrades in the
paid modules of the WordPress e-Commerce plugin.
Appendix B, Setting Up a WAMP Testing Platform, shows you how to set up a testing
ground on your own computer for installing WordPress and all associated plugins.
[2]
Preface
What you need for this book
For this book, you will need:
•
WordPress version 2.9 or above
•
WordPress e-Commerce plugin version 3.7.x or above
•
FTP software of your choice
•
WampServer (optional, but recommended)
Who this book is for
This book is for anyone interested in using WordPress as the basis for a store that can
sell physical items, downloads, or services.
It is ideal for a sole proprietor or small business owner with only basic, in-house
technical skills. Some prior knowledge of WordPress will help, but is not required.
No knowledge of PHP or CSS is expected, but that will also be helpful.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles and an
explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through the
use of the include directive."
A block of code is set as follows:
#header {
background: #73a0c5 url(‘images/kubrickheader.jpg') no-repeat
bottom center;
}
Any command-line input or output is written as follows:
user@yourhost:~$ mysql -h mysql-hostserver -u mysql-username -p
databasename < wp-database.sql
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "Once you
are finished with the General Settings, switch to the Presentation tab at the top of
the page."
[3]
Preface
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for us
to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to ,
and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a
note in the SUGGEST A TITLE form on www.packtpub.com or e-mail
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book on, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you fi
fin
nd a mistake in one of our books—maybe a mistake in the text
or the code—we would be grateful if you would report this to us. By doing so, you
can save other readers from frustration and help us improve subsequent versions
of this book. If you fi
fin
nd any errata, please report them by visiting http://www.
packtpub.com/support, selecting your book, clicking on the let us know link, and
entering the details of your errata. Once your errata are verifi
fieed, your submission
will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be
viewed by selecting your title from />[4]
Download at Wow! eBook
WWW.WOWEBOOK.COM
Preface
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
Please contact us at with a link to the suspected
pirated material.
We appreciate your help in protecting our authors, and our ability to bring you
valuable content.
Questions
You can contact us at if you are having a problem with
any aspect of the book, and we will do our best to address it.
[5]
Getting Started with
WordPress and e-Commerce
There are lots of great reasons to build an e-commerce website. Perhaps you are a
small business owner with goods or services to sell. Maybe you are an author or
musician who wants to sell documents, audio files, or other digital downloads.
Whether as part of a business, or a hobby, running an e-commerce site can increase
your sales, public profile, and your income.
In years past, building an e-commerce site required a vast amount of time, technical
knowledge, and money. It meant hand-coding the site from scratch by hiring one or
more developers, or purchasing a yearly license for a pre-built e-commerce solution.
Surely there must be an easier way. For anyone who starts researching on how to
create an online store, the myriad of options seem overwhelming at first. There
are literally hundreds of pre-built e-commerce packages available, most of which
promise to get the user "running in a matter of minutes". Unfortunately, they also
promise to separate the shop owner from hundreds, if not thousands, of dollars. On
the other hand, one can also find a few free e-commerce platforms. While most of
these are promising, the free cost platform often carries a high price tag in terms of
greater complexity or time wasted in learning the ropes of a new platform.
This brings us to WordPress. Not only is it a popular package for building a standard
website, but it can also serve as a powerful e-commerce platform with the addition of
the WordPress (WP) e-Commerce plugin. Thousands of people have already chosen
to use WordPress as the foundation for their online stores, and there are many
reasons why you should as well. Yes, WordPress is free, and yes, it's easy to use,
but it's also easy to modify and update. Extending the capabilities of WordPress is
a breeze, and you certainly do not need a team of developers to get your store up
and running.
Getting Started with WordPress and e-Commerce
As we will discover, WordPress is more than capable of handling an e-commerce
site. This chapter provides the context for how WordPress fits into the puzzle of ecommerce website construction, what it can do, and why it's so good at what it does.
This chapter covers the following topics:
•
Reasons for enabling WordPress for e-commerce
•
Some business and website possibilities for the combination of WordPress
and the e-Commerce plugin
•
What you sign up for when you decide to use WordPress for e-commerce
•
A basic overview of the features included in the WP e-Commerce plugin
Why WordPress
Maybe you are attracted to WordPress because it's free, it's easy to use, or perhaps
because you have a client who wants to add an e-commerce component to an
existing WordPress-based site within the next week. No matter what the case, you
need to know a little about what makes it special.
WordPress is free (as in money)
You don't have to pay anyone to use WordPress, whether for personal or commercial
usage. Whether you choose to run WordPress on a spare computer in your basement,
in a "shared" web hosting environment, or on a cluster of "enterprise-class" servers,
there are no licensing fees, support costs, upgrade fees, maintenance fees, or any
other kinds of costs.
Most themes and plugins are free as well.
WordPress is free (as in speech)
As an open source project, WordPress makes its code available for anyone to inspect.
If it doesn't do what you want, or if you just want to learn more about how certain
features work, you are free to poke around the core files and see what makes it tick.
You are not only welcome to make any changes or modifications as you see fit, but
you are encouraged to do so!
[8]
Chapter 1
WordPress is widely used
The WordPress project started in 2003. In a few short years, it has grown into the
largest self-hosted personal publishing tool in the world. Practically overnight,
WordPress has become a household name among the so-called blogging software.
Contrary to popular belief, it is not just a "blogging" application. While WordPress
certainly excels at running personal sites and blogs, it is capable of much more.
WordPress currently powers hundreds of thousands of websites, ranging from
personal blogs to Fortune 500 companies, and is seen daily by millions of people.
It is likely that you might already be familiar with WordPress.
WordPress is flexible and extensible
One of WordPress' greatest strengths lies in how easy it is to modify and extend.
Unhappy with the way your site looks? Try one of the hundreds of user-crafted
themes, or have a go at designing your own. The possibilities are limited only by
your imagination.
Since WordPress is open source, its functionality is nearly limitless as well.
Users have created literally hundreds of plugins to extend its capabilities. If the
software does not do what you want out-of-the-box, a plugin likely exists to add
that functionality. In fact, this book exists because of the extensibility added by
the WP e-Commerce plugin.
About the WP e-Commerce plugin
Created by the New Zealand-based Instinct Company, WP e-Commerce is an easy
and elegant way to integrate e-commerce capabilities into WordPress. The plugin
is free (released under the GNU General Public License), though some additional
modules are available as part of a paid upgrade.
WP e-Commerce is the product of over four years of development and testing. With
over 200,000 downloads to its fame (as of this writing), and featured as one of the
most popular plugins for WordPress, WP e-Commerce is the most tried-and-true
way to build an online store with WordPress.
It's an ideal solution for selling physical goods, services, and digital products online.
Downloads are available at .
[9]
Getting Started with WordPress and e-Commerce
Site and business possibilities
Just to whet your appetite and get your imagination running, let's take a quick tour
to see how people are using WP e-Commerce right now.
Photography shop
If you are an artist or photographer, why not make your product available to the
public eye through an online store? WP e-Commerce makes it easy to create listings
of your products, complete with sample images. An example of the product listing
can be seen in the following screenshot:
Customers can not only see a preview of your artistic photos, but they can also
specify what size print they would like, and the Price automatically updates to
reflect the differing Print Size. The price and size variation option has been used in
the intricate art website />
[ 10 ]