Book Image

PHP 5 E-commerce Development

By :
Book Image

PHP 5 E-commerce Development

By:

Overview of this book

<p>The popularity of online shopping has increased dramatically over the past few years. There are plenty of options available if you not are planning to build your own e-commerce solution but sometimes it's better to use your own solutions. It may be easy to find an e-commerce system but when it comes to extending it or using it you might come across a lot of difficulties.<br /><br />This book will show you how to create your own PHP framework that can be extended and used with ease, particularly for e-commerce sites. Using this framework you will be able to display and manage products, customize products, create wish-lists, make recommendations to customers based on previous purchases, send email notifications when certain products are in stock, rate the products online, and much more.<br /><br />This book helps you build a Model-View-Controller style framework, which is then used to put together an e-commerce application. The framework contains template management, database management, and user authentication management. With core functionality in place, e-commerce-focused features are gradually added to the framework including products, categories, customizable products with different variations and customer input, wish-lists, recommendations, the shopping basket, and a complete order process.<br />&nbsp;<br />At the end of the book, you will have an e-commerce architecture that will take you from viewing or searching for products, and adding them to your basket, through the checkout process and making payment for your order, to your order being dispatched. Focus is placed on flexibility, so that the framework can be extended as the needs of a particular store change, as illustrated by one of the appendices, which goes through the process of modifying the store to sell downloadable products, as well as physical ones.<br /><br />Supplementary information, such as how to market and promote an online store, as well as take regular backups and perform maintenance is also covered, ensuring you have every chance of success with you own e-commerce framework backed store.</p>
Table of Contents (23 chapters)
PHP 5 e-commerce Development
Credits
About the Author
About the Reviewers
Preface

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.

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 flexible 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.

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 profile 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

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 find 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).

Features
  • Browse and search for products

  • Rate and review products

  • Purchase products

  • Make payments and manage orders

  • Sell products through PlayTrade