23,50 €
Ubercart is an exciting open source e-commerce package that fully integrates your online store with Drupal. Ubercart leverages the advantages of Drupal's major core and contributed systems, providing your users with shopping cart functionality that integrates with other parts of your company or community web site. It can be used to sell shippable goods, downloadable products, recurring memberships, and event tickets, and to enable complex interactions with Drupal through various add-on contributions.
This book guides you through the process of creating, administrating and marketing an online store, providing information and tips for raising your sales and your customer support. It will also show you how to maintain and add advanced capabilities to your company's eShop.
If you are a merchant wanting to invest your precious time to update the online presence of your company, or a web site designer wanting to expand your business and offer innovative solutions to your clients, this book has been written for you. You don't need any programming experience to install and customize your electronic store. The procedure is well structured and easy and all we ask you to do is to follow some simple steps in order to complete some specific tasks in each chapter. The book will guide you through the installation and configuration of Drupal and Ubercart. From there it will cover specific areas like managing orders, customizing the frontend and user interface. At the end it covers the advanced topics of internet marketing techniques and Search Engine Optimization.
When you reach the end of the book, you'll have a working store and you'll have obtained all the required knowledge to customize it to your specific needs.
A practical guide to building and customizing a fully functional E-store with Ubercart and Drupal
This book will take you through the basics, like Drupal and Ubercart installation and common settings, and as we proceed through the chapters, we'll implement more advanced techniques.
Whether you know Drupal or not, this book will be your guide to creating a powerful e-commerce web site.
If you are a business owner wanting to create an eCommerce website for your company or to upgrade a company eShop to be easier to maintain and have advanced e-shopping capabilities, then this book is meant for you. You don't need any programming experience to use this book.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 352
Veröffentlichungsjahr: 2010
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 authors, 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: 1150310
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847199-20-1
www.packtpub.com
Cover Image by Filippo (<[email protected]>)
Authors
George Papadongonas
Yiannis Doxaras
Reviewer
Jose Argudo
Acquisition Editor
Usha Iyer
Development Editor
Chaitanya Apte
Technical Editors
Bhavesh Bhasin
Ishita Dhabalia
Copy Editor
Sanchari Mukherjee
Editorial Team Leader
Gagandeep Singh
Project Team Leader
Priya Mukherji
Project Coordinator
Leena Purkait
Indexers
Hemangini Bari
Rekha Nair
Proofreader
Chris Smith
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
George Papadongonas is the owner of Infowonders (http://www.infowonders.gr), a web development firm, located in Athens, Greece. He started his career as a freelance web developer in 2000 and works with small and medium size enterprises. He has experience in many development platforms, but fell in love with Drupal in 2007 and with Ubercart in 2008. He is a member of the Drupal Association and an active supporter of the open source community. His Twitter name is @infowonders.
Yiannis Doxaras is a senior open source developer and committer with more than eight years of experience in Java EE, PHP, Python, XHTML, CSS, and all related web frameworks. He has studied theoretical physics at UOA and NTUA. He has published more than 100 articles and posts about web technologies-related matters. Being a serial entrepreneur, he has worked with all major Greek Telcos, banks, and government services. In addition, he has coordinated research for European Community-funded projects and he is also an active innovation agent active in South Eastern Europe. Currently, he is focused on the areas of location-aware and augmented reality applications. Although he lives in Athens, he is a frequent traveler and in his limited free time enjoys running and technical reading. He is a dedicated user of open source technologies in every aspect of his academic and professional work.
This book would not have been written without the help and support of some great people: first of all, the Packt team and especially Usha Iyer, Leena Purkait, and Chaitanya Apte. Your guidance and patience during our first writing adventure was amazing.
We would also like to thank Dries Buytaert, the creator of Drupal and Ryan Szrama, the creator of Ubercart. Your personal projects became so important, that they affect the lives of thousands of people daily.
And of course, the Drupal and Ubercart communities for providing ideas, solving problems, and contributing fantastic modules.
Jose Argudo is a web developer from Valencia, Spain. After finishing his studies he started working for a web design company. Then, six years later, he decided to start working as a freelancer.
Now that some years have passed as a freelancer, he thinks it's the best decision he has ever taken, a decision that let him work with the tools he likes, such as Joomla!, Codeigniter, Cakephp, jQuery, and other well-known open source technologies.
His desire to learn and share his knowledge has led him to be a regular reviewer of books from Packt, such as Joomla! 1.5 Multimedia, Joomla! With Flash, Joomla! 1.5 SEO, Magento 1.3 Theme Design, and Symfony 1.3 Web Application Development.
Recently he has even published his own book, CodeIgniter 1.7 (ISBN 978-1-847199-48-5), which you can also find at Packt Publishing's site. If you work with PHP... take a look at it!
If you want to know more about him, you can check his site www.joseargudo.com.
To my brother, I wish him the best.
This book is dedicated to my wife Maria. I feel grateful for every day I spend with you.
--George PapadongonasThis book is dedicated to all open source developers out there. Their contributions over the years have provided this book a platform to describe and audience to address.
--Yiannis DoxarasUbercart is an exciting open source e-commerce package that fully integrates your online store with Drupal. Ubercart leverages the advantages of Drupal's major core and contributed systems, providing your users with shopping cart functionality that integrates with other parts of your company or community website. It can be used to sell shippable goods, downloadable products, recurring memberships, and event tickets, and to enable complex interactions with Drupal through various add-on contributions.
This book guides you through the process of creating, administrating, and marketing an online store, providing information and tips for raising your sales and your customer support. It will also show you how to maintain and add advanced capabilities to your company's e-shop.
If you are a merchant wanting to invest your precious time to update the online presence of your company, or a website designer wanting to expand your business and offer innovative solutions to your clients, this book has been written for you. You don't need any programming experience to install and customize your electronic store. The procedure is well structured and easy and all we ask you to do is to follow some simple steps in order to complete some specific tasks in each chapter. The book will guide you through the installation and configuration of Drupal and Ubercart. From there it will cover specific areas like managing orders, customizing the frontend and customizing the user interface. At the end it covers the advanced topics of Internet marketing techniques and Search Engine Optimization.
When you reach the end of the book, you'll have a working store and you'll have obtained all the required knowledge to customize it to your specific needs.
Chapter 1, Getting Started, provides some basic definitions on Drupal and Ubercart. In addition, it sets the context of the online store case study that will be developed throughout the book.
Chapter 2, Installation of Drupal and Ubercart, is a quick installation reference for Drupal, the required Drupal modules, and Ubercart.
Chapter 3, Basic Configuration, helps you to understand the basic Drupal and Ubercart configuration.
Chapter 4, Managing Categories, Products, and Attributes, will show how to manage categories using the Drupal taxonomy, how to create new products or import them from external files, and how to use the attribute system of Ubercart.
Chapter 5, Managing Shipping and Packaging, helps the user to manage shipping and packaging in a flexible way. In this chapter you'll learn how to configure them.
Chapter 6, Managing Taxes and Payments, helps the user to manage taxes and payments in a flexible way. In this chapter you'll learn how to configure them.
Chapter 7, Managing Customers and Orders, is focused on CRM, reporting, and after-sales support.
Chapter 8, Customizing the Frontend, will show you how to install a new theme, customize a theme, or create a new theme from scratch.
Chapter 9, User Interface Enhancement Techniques, helps you to implement more complex marketing techniques.
Chapter 10, Optimizing and Promoting Your Store, will show you how to make an Ubercart store faster, more secure, and more search engine friendly.
Appendix A, Hotel Bookings System for Ubercart, shows how Ubercart can be used not only for selling products, but also for offering services as well.
Appendix B, Modules Used in the Book, lists the modules you can download when working through the exercises for each of the chapters.
Appendix C, Free and Commercial Ubercart Themes, gives you details of some very interesting free and commercial Ubercart themes.
Actually, you only need a computer to start working with this book. In Chapter 2 we'll show you how to install PHP, a database, and a web server, if they aren't already installed on your system. We'll also show you how to use a remote server and install you store there.
If you are a business owner wanting to create an e-commerce website for your company or to upgrade a company e-shop to be easier to maintain and have advanced e-shopping capabilities, then this book is meant for you. You don't need any programming experience to use this book.
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: "There is a possibility of facing an error message at this stage. It shows up when register_globals is enabled."
A block of code is set as follows:
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: "Go to Home | Administer | Store administration | Configuration | Tax rates and settings."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
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 <[email protected]>, 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 <[email protected]>.
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.
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.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find 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 find 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 verified, 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 http://www.packtpub.com/support.
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 <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Building an e-commerce site used to be a very difficult and expensive procedure. A decade ago, if you wanted to build one, you had to hire one or more experienced developers to build an application for you from scratch, after working for several weeks. You had to pay a fair amount of money to build, customize, and support this application. In those days, only big companies could afford this cost.
Nowadays, things are much simpler: e-commerce applications are lighter, faster, and of course cheaper, which gives each merchant the capability to sell his or her products online. If you are a merchant wanting to invest your precious time to update the online presence of your company, or a website designer wanting to expand your business and offer innovated solutions to your clients—this book is written for you. You don't need any programming skills to install and customize an electronic store. The procedure is well structured and easy, and all we ask you to do is to follow some simple steps in order to complete some specific tasks in each chapter.
When you reach the end of this book, you'll have a working store and you'll have obtained all the knowledge required to customize it according to your specific needs.
Drupal is an award-winning, free, and open source Content Management System (CMS), winner in two categories of the Packt Publishing 2008 Open Source CMS Awards (http://www.packtpub.com/article/2008-open-source-cms-award-winner-announced). Drupal's source code is freely distributed under the terms of the GNU General Public License 2 (GPL). The GPL, unlike permissive free software licenses like BSD, is an example of a powerful copyleft license that imposes constrains on all the derived software components to be available under the same copyleft. Therefore, GPL grants the rights of the free software definition to the recipients of a computer program, and uses copyleft to ensure that the freedom is preserved, even when the software is changed or added to.
Unlike proprietary blogging or content management systems, Drupal's feature set is fully available to extend or customize as needed.
Drupal was started as a small content-sharing personal platform by Dries Buytaert in the University of Antwerp campus. When Dries left the university, it was published on the Internet to continue communication with the group. Thus, Drupal was hosted on Drop.org at first, until it became very popular with users asking for more and more functionality. Then Dries decided to make it open source software and started maintaining it with other code contributors from the open source community. Gradually, it became state-of-the-art software with a devoted community with hundreds and thousands of members. There are millions of websites built with Drupal, from personal blogs to the White House web page.
The main advantages of Drupal are:
To learn more about Drupal, browse to http://www.drupal.org.
Ubercart is not a standalone application, but it's a module for Drupal. This means that you first have to install and customize Drupal, and then install Ubercart and all its related third-party modules. Imagine how powerful this combination is. You won't have just a selling point for your products, but a complete platform to interact with your clients and market your company.
Some key aspects of Ubercart that make it the number-one solution for online shops with Drupal are:
For the end user to visually comprehend the rich features of the Ubercart and Drupal platform, the following are some examples of success stories. All shops are built on top of Drupal with extensive use of Ubercart and its robust product catalog:
To learn more about Ubercart browse to http://www.ubercart.org or you can also visit a live site example page at http://www.ubercart.org/site.
This book will show you how to build a basic store using Drupal and Ubercart. We will guide you through the administrative section of the application and show you how to customize your store. Then, you'll learn how to manage categories, how to create products, and how to import them from external files.
As we proceed, you'll customize shipping, taxes, and payments, and learn about order management and customer relationship management. You'll install a ready-made Drupal template and you'll also learn how to create one from scratch. Finally, you'll learn how to create a better user interface and optimize your store.
The store that we are going to build in this book is a fully working electronics store.
So, let's see the most important sections.
The product catalog is the main navigation system in our store. We have our main categories and subcategories, offering a structured way to the clients to browse the website and locate their favorite products. When the visitors reach a page with no more subcategories, they can see a list of all the available products of this category.
When clients click on a product from the catalog, they can see all the details of this product. If it has attributes, like size or color, they also have to select them. Finally, they can add this product to the shopping cart or the wish list, depending on the functionality that we have installed.
The shopping cart is the page where the customers can check all the products that they have added so far. They can update the quantities, remove one or more products, or continue to the checkout page.
The checkout page is the final step of the shopping process. Here, the customer enters his or her delivery and billing information, selects a payment and a shipping method, and completes his or her order. After that, you, the shop owner, have to collect the products and fulfill the order.
Of course, one of the most important sections of the website is the administration section. You gain access to it by entering your username and password. Throughout this book, you'll spend all your time in this section, customizing not only the store pages, but also the complete Drupal installation.
In this chapter, we have gone through the following key points:
In the next chapter we are going to install a basic Drupal site, add the Ubercart module, and start making customizations.
The beginning is half of everything. A proper installation of Drupal and Ubercart will save you from future headaches and will guarantee the correct functioning of your online store. This chapter is a quick installation reference for Drupal, the required Drupal modules, and Ubercart.
Ubercart is not a standalone e-commerce application, but it comes as a Drupal module. That means you have to first install Drupal and all the required Drupal modules on a server with the minimum requirements, before installing Ubercart. You don't have to be an expert programmer or a system administrator in order to complete the following process. We'll first give you a brief explanation of the underlying technologies, and then we'll continue with a step-by-step guide. At the end of this chapter, you'll have the online store installed on your local or remote machine and you'll be ready to make all the required customizations to the frontend and the backend, depending on your needs.
The topics that we will discuss in this chapter are:
In order to successfully install and use your online store, your system must meet the following requirements:
Now, let's elaborate a little more on the above requirements:
The MySQL database of a basic installation contains about 50 tables and every new installed module creates one or more new tables. If you check your database after the installation of Ubercart, you'll find that there are 100 tables in your database. These tables contain data such as pages, products, images, categories, orders, payments, caching information for your pages, theming information, comments from your visitors, menus, user information, and so on.
PHP: PHP is a scripting language, ideal for web development. It began as a small personal project, but soon became a very popular scripting language. Drupal is written in PHP, so it's absolutely necessary and there is no alternative to it. Drupal 6 works fine with PHP 4, but PHP 5 is recommended and that's what we're going to use in this book.Some PHP extensions are needed for our installation. We'll mention them briefly here, so you can consult your hosting provider or examine your local system to check that everything is fine. The easiest way to check your PHP parameters is to use phpinfo. It's a function that returns information about the PHP environment on your server. All you have to do is to create a blank file named phpinfo.php in your server and insert the following code using a text editor:
This is a small PHP script that runs the phpinfo function and displays the results on your screen. If you browse to phpinfo.php, you'll see a page with your PHP configuration.
The basic PHP requirements are:
When you start building your online store, it's better to do it on a local environment. There, you can do all the tests, experiment, try different options and solutions, and correct all the problems in a closed and secure environment before going live.
You have two basic choices: manually install and configure all the components, or use a complete web server package.
The advantage of the first choice is that you have the absolute control of the entire process, but its disadvantage is that it's time consuming and sometimes difficult to configure it right.
We prefer the second method, because it's fast, easy, and reliable.
We recommend XAMPP (http://www.apachefriends.org/en/xampp.html), a free distribution package for Linux, Windows, and Mac OS X, containing Apache, PHP, MySQL, OpenSSL for Secure Sockets Layer support, ProFTPD FTP server (FileZilla in the Windows version), and phpMyAdmin for the administration of MySQL databases. It's free, easy to install and uninstall, needs little or no configuration, easy to use, and very fast and stable.
So let's start the installation process:
If you check the root folder of your hard disk, you'll now see a new folder named xampp. Inside, there are all the files of the package. Among all the others there is one application file named xampp-control, which opens the control panel for XAMPP.
Double-click on xampp-control and open it. The Control Panel opens in a new window. It has a very simple layout, showing the three main applications (Apache, MySQL, and FTP), an indicator about the status for each one of them, and a button to turn them ON or OFF. If everything is OK, you'll see green indicators showing that all XAMPP components are Running.Now it's time to test that everything works. Using your browser, open the following URL: http://localhost. Select your language and you'll be transferred to the home page of XAMPP. On the left, there is a menu for all the basic actions. You can check the status of the applications, check the security of your installation and your pages, read online documentation about Apache, PHP, and MySQL, test and see the source code of some very interesting demo applications, and use some very useful tools like phpMyAdmin for the administration of MySQL databases and Webalizer for Web Stats.Before you download Drupal, you have to create a blank MySQL database. This database will be used by Drupal to store all the data of your site. So, from the left menu of the XAMPP home page, select phpMyAdmin, located at the bottom of the page. It will open in a new window. Under the label Create new database, enter the name of your database and click on the Create button to continue. If you haven't changed anything, the default MySQL username is root and there is no password.That's it! Now your local environment is ready to install Drupal. If you're not going to use a commercial hosting service immediately, skip the next section and go to the Downloading and installing Drupal section.
If you're in a hurry, or you just don't want to mess about with local web server installations, you can find a commercial hosting service and host your online store there. Nowadays, most companies support Drupal without any problem, because it's very popular and there is high demand for it. Look for a provider with reliability and speed of access, with plenty of web space and bandwidth. You need FTP access to upload the required files, and enough privileges to create a new database and to edit .htaccess and php.ini files.
Go to http://drupal.org/hosting to find a list of companies that provide Drupal hosting services.
When you select your hosting company and sign up, they'll give you a username and password and a link to access the Control Panel of your package and manage your website. In this section, we'll work with cPanel, but the process is almost identical for the other GUI control panels such as Plesk.
Before installing Drupal, you have to create a database. We'll show you here how to create a MySQL database, but a similar process is followed for a PostgreSQL database.
Now we have a functional Drupal site. Can we proceed with Ubercart installation? Not yet! First we have to install a few more Drupal modules.
