20,53 €
Drupal is a free and open-source modular web application framework and content management system (CMS) written in PHP that can run in many environments, including Windows, Mac OS X, Linux, and FreeBSD. Drupal e-Commerce is a free, open-source, feature-rich, flexible package of modules that seamlessly adds full e-Store capabilities to Drupal.
Drupal e-Commerce is the combination of Drupal, the award-winning Drupal 5 content management system, and the e-Commerce package of modules that can be plugged into it, bringing a wealth of e-commerce functionality to the software.
In this book you will learn how to use the Drupal content management system along with its e-Commerce modules to set up and manage an online shop. We will install the software, have a look at its features, plan our shop, create our shop, look at customer management, create a design for our shop, and cover security, taxes, shipping, and even marketing our business!
If you're new to Drupal and want to set up a powerful e-commerce system, this book is for you. If you've some experience of working with Drupal and want to understand how its e-commerce options can be used to power an online shop, this book will also prove invaluable.
This book will show you how to sell online using the award-winning open-source Drupal web application. No prior experience of Drupal is required; you will learn all you need as you step through the creation of an online shop.
You will learn the basics of Drupal, and see how to use the standard features of Drupal to begin construction of an online shop, and improve the selling interface, handling of orders, and reporting with new modules and other customizations.
The book starts with the basics of Drupal and then steps you through the creation of an online shop, exploring Drupal further as needed. Only the features of Drupal relevant to the e-commerce application will be covered.
Written in a straightforward, easy-to-understand manner, the book provides the essentials of getting your e-commerce website up and running with Drupal.
This book is for people who want to start selling online as quickly as possible, and want to see how to use the proven Drupal platform to achieve this.
The book is ideal for use in a small business with only basic in-house technical skills. It will also be useful for developers who not only want to create an e-commerce site, but also want a CMS platform for expanding the site in the future. No prior knowledge of Drupal is required. No PHP experience is expected, although it will be useful. Basic knowledge of e-commerce will also be useful, although the main concepts are introduced and covered as required.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 253
Veröffentlichungsjahr: 2008
Copyright © 2008 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, Packt Publishing, nor its dealers or 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 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 2008
Production Reference: 1180308
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847194-06-0
www.packtpub.com
Cover Image by Nilesh R. Mohite (<[email protected]>)
Author
Michael Peacock
Reviewers
Bruno Massa
Gordon Heydon
Greg Holsclaw
Senior Acquisition Editor
Douglas Paterson
Development Editor
Nikhil Bangera
Technical Editor
Dhiraj Chandiramani
Editorial Team Leader
Mithil Kulkarni
Project Manager
Abhijeet Deobhakta
Project Coordinator
Abhijeet Deobhakta
Indexer
Hemangini Bari
Proofreader
Chris Smith
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat
Michael Peacock is a web developer and senior partner of Peacock, Carter & Associates (http://www.peacockcarter.co.uk) a web design and development business. Michael loves building websites and web applications, and when he isn't, likes to read, watch films, and occasionally take part in amateur dramatics.
I would like to thank everyone at Packt Publishing for making this book possible, in particular Douglas Patterson for the idea of the book, and helping me define a structure for it. Patricia Weir, Abhijeet Deobhakta, and Nikhil Bangera for keeping me on track, and Dhiraj Chandiramani for preparing the book for publication. My thanks also goes to the reviewers (Greg Holsclaw, Bruno Massa, and Gordon Heydon) who helped improve the quality of the book, and made sure everything was in check.
I'd also like to thank my fiancée Emma for her support while working on the book, and my business partner Richard for keeping the business running during the times when I was writing about websites as opposed to building them.
A special mention, and thanks is due to Martin Baker of Merrill Valley Photography (http://www.merrillvalleyphotography.co.uk/) for his contributions to the photography section in Chapter 3.
Finally, I'd like to thank you, the reader; I hope that you enjoy this book and end up with a fantastic website and store!
Bruno Massa is one of the three authors and maintainers of the e-Commerce module for Drupal. Graduated in Business, he is founder and president of Titan Atlas, a Brazilian dotcom company. Massa is a national expert in e-business and open-source software applications in Brazil.
Greg Holsclaw holds a Bachelor's Degree in Computational Mathematics and has been developing intranet and internet web applications for the past five years. After developing ASP applications for a large engineering division for a number of years, Greg became acquainted with PHP and Drupal, first to develop personal projects, which then led to a full time Drupal development position at a self-funded startup.
This book takes Drupal, a powerful and extendable Content Management System, and uses it to set up and manage an online store using the available e-Commerce modules. By integrating the store directly into the website, customers are provided with a consistent experience with the other areas of the site.
Many aspects of Drupal and e-commerce are covered as well as the e-Commerce modules to create not only a great online store, but also a great website.
Chapter 1 introduces you to Drupal, e-commerce, and the advantages of using Drupal e-Commerce rather than regular online shopping carts before going through the installation process and performing some basic configurations.
Chapter 2 looks at how to use Drupal and many of its Content Management features to create a website.
Chapter 3 goes through steps involved in planning an online shop including legal issues, the shop's structure, product details, and how to take great photographs of products for the store.
Chapter 4 takes our planning from Chapter 3 to show you how to create an online product catalog.
Chapter 5 shows you how to manage users, roles, and permissions within Drupal, particularly to create and manage customers to use the store, and staff members to help manage the store.
Chapter 6 takes a look at branding the website and the store to provide a website that reflects your business.
Chapter 7 lets you start making money from your store by looking through and customizing the checkout process as well as taking payments from customers.
Chapter 8 helps you to create an even better selling experience for customers by looking at additional modules and features that can make the website and the overall selling experience even better. This looks at adding images to product listings, enabling search options and different ways of offering discount or incentive to customers including bulk purchasing discounts.
Chapter 9 takes a detailed look at taxes, payment, and shipping options allowing you to accept as many different forms of payment as possible, as well as dealing with taxation issues and calculating shipping prices based on the items ordered or the location of the customer.
Chapter 10 takes your new site, secures it, and deploys it onto the Internet ready for use to generate business, as well as explaining how to maintain the shop.
Chapter 11 looks at generating invoices and a more advanced way to manage your customers, by installing a Customer Relationship Manager into Drupal to help manage customer support, appointments, and even telephone calls.
Chapter 12 gives you the knowledge you need to help promote and market your business online by looking at optimizing the store for search engines, advertising your site, and helping to bring back visitors to your site as well as some important tips and advice when advertising, promoting, and marketing on the Web!
Drupal is a free and open-source modular web application framework and content management system (CMS) written in PHP that can run in many environments, including Windows, Mac OS X, Linux, and FreeBSD. You just need to have a development environment set up on your computer, e.g. WAMP, or XAMP.
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.
There are three styles for code. Code words in text are shown as follows: "Support for friendly or clean URLs requires mod_rewrite and the ability to use .htaccess files."
A block of code will be set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".
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 drop an email to <[email protected]>, making sure to mention the book title in 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 email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, 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.
Visit http://www.packtpub.com/files/code/4060_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, 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 have been verified, your submission will be accepted and the errata will be added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
You can contact us at <[email protected]> if you are having a problem with some aspect of the book, and we will do our best to address it.
Welcome to Drupal e-Commerce! During the course of this book we are going to look at how to use a content management system in particular Drupal as well as its e-Commerce module to set up and manage an online shop. We will install the software, have a look at its features, plan our shop, create our shop, look at customer management, create a design for our shop, and cover security, taxes, shipping, and even marketing our business.
In this chapter, you will learn:
We will also take a look at the store we will create during the course of this book, Doug's Dinos.
Content Management Systems are one of the common methods for creating and managing content on the Internet and on intranets, particularly in environments where there is more than one person working on the content, or where there is a lot of content involved.
These systems generally have the ability for users to:
With a CMS, content and design are kept separate, which means that the design of a website can completely change, and this will have no impact on the content of the website. This is quite an important feature as it means that the design need only be changed once, and not across each page of the website, making it easy for websites of any size to easily and quickly change design, and it protects the design, as content editors do not need to integrate design into their content—which could cause problems.
The diagram opposite illustrates the separation of these layers and how they are brought together when the page loads into the visitors' web browsers.
Drupal is a free, open-source content management system, which allows individuals or a community of users to easily publish, manage, and organize a wide variety of content on a website. The Drupal website, containing lots of information on Drupal, its history, and its features is http://drupal.org/.
E-Commerce is the process of conducting business, by means of the sale and purchase of goods and services as well as the transfer of funds, over networks and through computers. We will create an online shop that will enable us to do business electronically over networks (the Internet) allowing us to sell goods as well as receive payments electronically, although it can also cater for the option for manual payments by cheque or money order.
E-Commerce can help us reach new potential with our business, making our products and services available to a wider audience. It can of course do more for us; it's just a case of where we want it to end! It can also:
...and why is it better than a regular online shopping cart?
Drupal e-Commerce is the combination of Drupal, the content management system, and the e-Commerce module, which can be plugged into it, bringing a wealth of e-commerce functionality to the software.
If we consider websites that are purely shops, they provide the customer with one thing—the opportunity to buy some products or services. Websites that are not at all shops, generally provide information on a subject, and sometimes offer visitors additional features or access to online communities. Drupal e-Commerce helps us bridge the gap in a seamless fashion. Traditionally, if someone wanted a website that had an online shop as well as a website, the two would be bolted together similar to a garage being joined to a house. With Drupal e-Commerce we are not bolting the two together, we are extending one into the other, similar to a new extension being added to a house.
The figure above illustrates these different types of websites and shows that with Drupal e-Commerce the shop and website are the same and interlinked, as opposed to two separate entities.
With separate shopping carts bolted onto a website, they generally loose the consistent theme of the website, and provide an added bonus for the visitor. We will create an online shop and an online resource where each complements the other. As e-Commerce is embedded into Drupal it allows us to make the most of a very powerful CMS to improve the presentation of our products.
Doug is an avid dinosaur and model enthusiast, and runs his own shop and museum selling model dinosaurs and offering information and facts on various dinosaurs. He only has one property, and it's based a few miles outside the center of Newcastle, a large city in the UK. Because his store isn't based in the center, he doesn't get as much business from tourists and visitors to the city as he would like, and his main customer base is school children in the local area; occasionally local schools make a few bulk orders from him and bring a few large groups to see the museum.
Because Doug's business has been slowly declining for the past few years, he wants to set up a website to advertise his store and museum but also to sell models online. He hopes that this will increase his sales as he will be able to serve customers across the globe, and also as tourists and visitors to the city will be more likely to find out about his museum and realize it is only a short bus journey from the center, he may get more customers for the museum too.
Throughout the course of this book, we are going to create an e-commerce website for Doug and his business.
Now that we know what Drupal and e-Commerce are, and we have a website and shop to build, it is time to download and install the software. This section contains some detailed technical information regarding requirements and installation steps.
This assumes that you have a development environment set up on your own computer, e.g. WAMP, or XAMP. See Appendix A for details on installing a development environment. We will deploy our shop onto the web once it is ready in Chapter 10—Securing, Deploying, and Maintaining Your Shop.
If you already have a development environment set up which differs from the one detailed in Appendix A, you need to be aware of the requirements for both Drupal and the e-Commerce module to ensure your development environment supports the software.
More details on Drupal requirements are available in the Drupal handbook, http://drupal.org/requirements. There are also some guidelines on setting up your own development server environment on the Drupal website at http://drupal.org/node/260.
We need to:
We can download a copy of Drupal from the download page on the Drupal website http://drupal.org/download; this page is for the Drupal project (there are other downloads available from the downloads link on the website's menu); the version we want to download is one of the 5.x range, (Drupal e-Commerce requires at least version 5.2) which at the time of writing was 5.4
Once we have downloaded Drupal, we should use an unzipping program (such as WinZip, Power archiver, or Windows' built-in "compressed folders" system) to unzip the archive and place it in our development environment's web folder (see Appendix A for more information).
More technical installation details are available in the INSTALL.txt file in the folder we have just unzipped.
We now need to create a database, which Drupal will utilize; to do this we need to visit our phpMyAdmin page within our development environment (see Appendix A for more information); typically this will be located at http://localhost/phpmyadmin/. On the page that loads there is a textbox for creating a new database; let's call our new database drupalecom and then click Create to create the new database.
Now that we have our database, we can run the Drupal install script; we will need to have our database username and password to hand (see Appendix A if you used that method to create a development environment). For most development environment software such as WAMP and XAMP, the username and password is typically 'root' with no password.
The Drupal installer can be accessed by visiting the Drupal directory in our development environment, which is http://localhost/drupal-5.7/; when we visit this page Drupal detects that it has not yet been installed and will take us to the installer page.
Here we need to enter our Database name, username, and our Database password, so Drupal can connect to the database and install the default data. The two database types we have are mysql and mysqli. mysqli is an improved mysql driver (hence the i) but is not available on all installations; if you are in doubt, just choose mysql.
Once we have entered that information, we can click the Save configuration button. If all goes well, we should now see a screen saying Drupal installation is complete; if not we will be taken back to the page shown above and informed of what information was incorrect so we can adjust it.
If we now proceed back to our main Drupal directory, http://localhost/ drupal-5.7/, we can see that Drupal has indeed been installed and we are asked to create the first account, which will be given full administrator privileges.
To create this account we only need to enter a username and an email address and then click Create new account.
You may see an error message on the next page, something along the lines of:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\drupal-5.7\includes\common.inc on line 1979.
We don't need to worry about this error; it is just telling us that it failed to email the administrator account password to us, which is understandable since we don't have a mail server configured within our development environment. When we put the website online in a live hosting environment we shouldn't have these problems.
The password that Drupal has generated for us is shown on the page with the error message; we need to take a note of the password.
We also have an option of changing our account password on this page, and making other changes to our account, including setting our time zone, and setting a signature for our posts and messages.
That's all there is to installing Drupal! Before we move on to the e-commerce module, let's take a look at the basic settings available to tweak and change.
We can get to the configuration settings from the links that are on the front page of our Drupal installation.
The customize and configure link then takes us to the Site Configuration page, which contains a range of different configuration sections:
The Administration theme allows us to change the theme and style of the administrative section of Drupal, which isn't that important right now—it's more of a personal preference for administrators.
The mod_rewrite Apache module can allow us to enable clean URLs within Drupal; this would change links from things like http://www.example.com/?q=node/83 to something that looks more presentable to the end user, such as http://www.example.com/node/83. It provides no additional features or functions, but it does make things easier for the user, allowing them to remember URLs more easily. Let's click the Clean URLs link and enable the feature. If you don't have the mod_rewrite module installed, the handbook page on Clean URLs link provides more information on setting this up.
Within this page we only have the option to enable or disable the feature, but there are a couple of useful links in there too.
The first link leads to some more technical details on the Clean URLs feature and the second is a test to see if the feature can be enabled on our installation. Provided we are running an Apache web server, and have the mod_rewrite module enabled (if you followed Appendix A, that is the case) the feature should work, so let's click the test link. If all goes well, we should be sent back to the same page, but without the links at the bottom. Doug doesn't like websites with "un-clean" URLs and wants them to be clean. To enable this feature, we just need to click the Enabled option and then click the Save configuration button.
The Date and time settings allow us to set the default time zone. We will have to enable it if we want users to be able to set their own time zones and the format in which dates will be shown on our site.
Although Doug's store is based in the UK, he is hoping to target users in other countries too, and sees a larger potential with the US market, so he wants the default time zone set accordingly to the US. Because there will be customers from the UK and other countries, Doug also wants users to be able to set their own time zone, so we need to ensure that feature is enabled. Let's leave the short and medium date formats, as they are by default set to American style (mm/dd/yyyy).
With these changes made, we just click Save configuration to apply the changes.
For future reference, we may wish to install the auto time zone module at some point, to automatically adjust time zones with the user's time zone.
The Error reporting
