Selling Online with Drupal e-Commerce Walk through the creation of an online store with Drupal's e-Commerce module Michael Peacock BIRMINGHAM - MUMBAI This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Selling Online with Drupal e-Commerce 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]) This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Credits Author Project Manager Michael Peacock Abhijeet Deobhakta Reviewers Project Coordinator Bruno Massa Abhijeet Deobhakta Gordon Heydon Greg Holsclaw Indexer Hemangini Bari Senior Acquisition Editor Douglas Paterson Proofreader Chris Smith Development Editor Nikhil Bangera Production Coordinator Aparna Bhagat Technical Editor Dhiraj Chandiramani Cover Work Aparna Bhagat Editorial Team Leader Mithil Kulkarni This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 About the Author 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! This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 About the Reviewers 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 material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Table of Contents Preface 1 Chapter 1: Introduction and Installation 5 What is a CMS and What is Drupal? 5 What is E-Commerce and What can it do for Us? 7 What is Drupal e-Commerce? 7 Our Site 8 Installation 9 Downloading Drupal 10 Installing Drupal 10 Configuring Drupal 13 Administration Theme 13 Clean URLs 14 Date and Time 14 Error Reporting 16 File System 17 Image Toolkit 18 Input Formats 18 Performance 19 Site Information 21 Site Maintenance 22 The Drupal e-Commerce Module 23 Downloading the Module 23 Installing the Modules 24 Playing Together 26 Summary 26 Chapter 2: Getting Started with Drupal 27 Preparing the Content 27 Home Page 28 This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Table of Contents Contact Page 28 Dinosaur Section 29 Museum Section 29 Content Management 30 Creating Content 30 Title and Body 31 Input, Product, and Log 31 Final Page Options 32 Menu Management 33 Default Homepage 34 Creating the Content 35 Home Page 35 Contact Page 36 Dinosaur and Museum Sections 37 Other Content Modules 38 Contact Form 38 Blog 40 Photo Gallery 41 Summary 41 Chapter 3: Planning Your Shop 43 Planning to Sell Online 43 Legal Issues 44 Disability Discrimination 45 Distance Selling 45 Companies Act and Trust 45 Trade Descriptions 46 Spam Laws 46 Privacy Policies and Data Protection 46 General Planning 46 Product Types 47 Product Groupings 47 Product Information 48 Planning Our Shop 48 Product Lineup 49 Sample Product—Shippable Goods 49 Sample Product—Non-Shippable Goods 50 Sample Product—Apparel 51 Getting the Message Across 51 A Picture Says a Thousand Words 52 Equipment 52 Camera Settings 53 Setup 54 [ ii ] This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Table of Contents Post Processing 55 How Not to Advertise a Product? 56 Example One—Detail 56 Example Two—No Photo 56 Example Three—Spot the Difference? 57 Customer Service 57 Summary 58 Chapter 4: Creating Your Product Catalog 59 Further e-Commerce Configuration 59 Creating Products 61 Creating a Shippable Product 62 The Finished Product 65 Creating a Non-Shippable Product 66 Repair Service 66 Education Information Sheets 67 Creating Apparel 69 Creating the Product 69 Creating Variations 70 The Finished Product 74 Grouping Products 75 Grouping the Products 75 Our Store 76 Product Listings 76 Product Information 76 Adding to the Cart 77 The Shopping Cart 77 Summary 78 Chapter 5: Customers and Staff 79 Users, Roles, and Permissions 79 Roles and Permissions 80 Settings and Rules 81 User Registration Settings 81 User E-Mail Settings 82 Picture Settings 83 Permissions and Taxonomy Access Control 84 What is Taxonomy? 84 Creating Categories 84 Categorizing Content 85 Restricting Access Based on Taxonomy Access Control 86 Customers 87 Customer Roles 87 Role Assignments 88 Reminder: Forcing Customers to be Users 90 [ iii ] This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065 Table of Contents Customer Management 91 User Order History 92 Contacting a User 93 Staff 93 Planning 94 Creating Roles 94 Stock Assistant 94 Checkout Manager 95 Creating the users 96 Summary 96 Chapter 6: Branding Your Site 97 Themes 97 Minnelli 98 Marvin 99 Bluemarine 99 Pushbutton 100 Garland 100 Chameleon 101 Customizing the Default Theme 102 Color Scheme 102 Belgian Chocolate Color Set 104 Mediterrano Color Set 104 Shiny Tomato Color Set 105 Toggle Display 105 Logo Image Settings 106 Shortcut Icon Settings 107 The Customized Skin 108 Installing and Managing Themes 109 Installing Themes 109 Managing Themes 110 Creating a Theme 111 Template Files 112 Summary 114 Chapter 7: Checkout and Taking Payments 115 Finalizing the Store Ready for Customers 115 What's Missing? 116 Taking Addresses 116 Taking Payments 116 Let's Try Again 117 How the Checkout Process Works 120 How to Customize the Checkout Process 120 Checkout Screen Order 121 [ iv ] This material is copyright and is licensed for the sole use by lawrence rambert on 16th June 2009 2012 price st, , rahway, , 07065