PHP e-commerce [ 8 ] eBay According to eBay's website, there are approximately 84 million active users of eBay, with users trading more than $1,900 worth of goods each second. That means 84 million of us are using eBay to buy and sell goods, either as a business sustaining a regular turnover, or to try and make a little extra cash by selling unwanted or unneeded things knocking about the house. eBay is a social e-commerce site, operating as an online auction house, whereby they don't actually sell anything themselves, but instead allow their community of users to not only buy but also sell through their site. This not only illustrates the popularity of e-commerce, but also that there is money to be made in providing a stage for low (and high) volume online purchases. Amazon With revenue of over $19 billion in 2008, Amazon is one of the most popular e-commerce sites on the Internet. Research in early 2009 indicated that it was the favorite retailer for both video and music in the UK. Brick 'N Mortar stores Large, established Brick 'N Mortar stores such as Wal-Mart, Tesco, and Borders use online shops to sell the products they generally keep in store. With the likes of Wal-Mart and Tesco, customers often book a delivery timeslot for their groceries to be delivered. They also offer more than what is available in store, which they can easily bolt on for the convenience of their customers. With online retail, sellers are not conned to what they can stock on the shelves, but what they can store in their distribution warehouses. Smaller, niche-based Brick 'N Mortar stores use online selling as a way to target their products to a wider audience, without the limitation of their existing physical presence. Service-based companies Companies such as 37signals are setting up online applications (such as Project Management tool, BaseCamp) with monthly subscription models. Other examples of such sites include large le distribution websites (allowing you to "e-mail" large les using a third-party website) and premium features on certain websites, for example Get Satisfaction. This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Chapter 1 [ 9 ] Why use e-commerce? The popularity of online shopping has increased dramatically over the past few years. Not only does it provide the convenience of allowing customers to shop in the comfort of their own home, it also allows businesses to trade on a global marketplace, targeting even more potential customers. Because everything is done electronically, e-commerce stores can also help generate recurring revenue, by recommending new products to customers based on previous purchases, and by keeping them up to date with the store's catalog. Rolling out your own framework Throughout the course of this book, we are going to build a framework of our own, using PHP, as opposed to making use of an existing product. Sometimes, it is more appropriate to use existing solutions; sometimes it is better to use your own solutions. As you are reading this book, hopefully you know why you want to create your own framework. However, let's look at why we are going to create ours. Why PHP? PHP is a very popular language, and because it isn't a framework in its own right, we can easily structure our framework out of it, however we wish. The main choice for a programming language is generally down to your own preference. Most modern web hosts support PHP and MySQL, and while languages like Ruby on Rails are gaining popularity, at the moment hosting for them is not as common. This book assumes that you already have a reasonable understanding of PHP, so hopefully that will also be an important factor in why you want to use PHP; perhaps you need to develop something quickly, and don't want to use a language or platform that is out of your comfort zone. Why a framework? Instead of looking to create an e-commerce system, designed to perform all types of e-commerce tasks, we will create a framework. This will make it easy to extend the needs of any e-commerce project with minimal effort. Because we are creating our own framework, it is going to be something we will know and understand very well, meaning that if we do need to extend it or use it, we can do so easily. This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 PHP e-commerce [ 10 ] While a typical e-commerce system may show products within a browse or search interface, a framework could allow us to integrate products into other areas of a website; for instance, pulling certain categories of product into relevant pages, particularly useful for a website that needs to do more than just sell online. For example, if we were selling books, we could have pages dedicated to certain authors with information, reviews, and other media about the author, and then integrate some of their popular products into the page. When to use an existing package? There are already a number of e-commerce systems available, written in various different languages, and sometimes it is more appropriate to use such a product, for example: When you have a tight deadline for a project, and you don't have a framework in place When there are lots of developers on the project; something with more documentation available would probably be more useful, at least initially (unless the framework was developed by most of the developers) When a client has indicated a preference When the features match—if another system has all the features you need and want, and it works in a way you are comfortable with, then it would be more appropriate to use the existing system Existing products Of the e-commerce applications that are already available, the following are amongst the most popular: Magento: This is a very modular and exible e-commerce platform, which is becoming more widespread in its usage. Drupal e-commerce: Drupal is a popular content management system, which is easy to extend and modify. There are two packages of modules, Ubercart and Drupal e-commerce, which add a wealth of e-commerce functionality to the popular CMS. CubeCart: This is a simple-to-use e-commerce solution, available with both free and paid versions. A look at e-commerce sites We have already taken a brief look at who is using e-commerce; let's take a more detailed look at some popular e-commerce sites, and see how they work and what features they provide to their users. • • • • • • • This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 Chapter 1 [ 11 ] iStockphoto iStockphoto is a popular website for buying and selling stock photography. Photographers can register on the website and submit their photographs for approval. Approved photographs can then be purchased by customers for a number of credits, depending on the size of the photograph and the license they wish to purchase it under. Features Approval process for sellers: Photographs are approved by iStockphoto before being available for purchase. • Flexibility for sellers: Sellers can choose their prices, multiple image sizes, and the licenses they wish to sell the image under. • Credits: Because most stock photograph purchases equate to only a few dollars, iStockphoto has a credits system whereby the customers purchase at least $10 of credits, which are assigned to their accounts. These credits are then deducted when they make a purchase. • Social: Photographs can be rated and commented on, making the website very social and interactive. WooThemes WooThemes is quickly becoming a popular online shop for custom themes, but operates quite differently to most theme-selling websites. Purchases are either a theme package (the theme and accompanying color schemes), or a one-off fee along with a monthly subscription allowing the customer to purchase any themes they wish in a particular month, backed up with reassurances of a minimum number of themes each month. WooThemes also invites established members of the web design community to create themes for the site, helping to raise the prole of the site and continue their ability to offer quality themes. Features In-depth knowledge of industry and respected designers to help increase their product offering (not strictly a feature) Two types of purchases, each with two tiers, providing access to different downloads: Recurring payments Membership-based offers • • • ° ° This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 PHP e-commerce [ 12 ] eBay We discussed earlier, that eBay is an online auction house, but what features does it have to support its business? Features Powerful search feature to nd products Purchase products directly—"Buy it now" Bid for products/express interest in purchasing Make payments and manage orders Amazon While Amazon doesn't operate as an online auction house, as eBay does, it still has a number of social aspects to it, including ratings, reviews, and recommendations. It also allows users of the site to sell their own copies of products listed within the store, through the Amazon Marketplace. This market place functionality is also integrated within their main product listing, informing customers that they can also purchase used and new copies of a product, from non-Amazon sellers, through its market place. Features On a basic level, Amazon.com provides the following features to its users: Browse and search for products Rate and review products Purchase products Make payments and manage orders Sell products through the Marketplace Play.com Play.com operates in a similar way to Amazon: it not only sells products, but also allows users to sell their own items (branded as PlayTrade). One notable difference with Play.com is the categorization of products, which also allows more dynamic categories such as products under a certain amount, or seasonal items (for example, Christmas present ideas). • • • • • • • • • This material is copyright and is licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 . licensed for the sole use by jackie tracey on 23rd February 2010 953 Quincy Drive, , Brick, , 08724 PHP e-commerce [ 10 ] While a typical e-commerce system may show products within a browse or search. looking to create an e-commerce system, designed to perform all types of e-commerce tasks, we will create a framework. This will make it easy to extend the needs of any e-commerce project with. usage. Drupal e-commerce: Drupal is a popular content management system, which is easy to extend and modify. There are two packages of modules, Ubercart and Drupal e-commerce, which add a wealth of e-commerce