Book Image

Deep Inside osCommerce: The Cookbook

By : Monika Mathe
Book Image

Deep Inside osCommerce: The Cookbook

By: Monika Mathe

Overview of this book

osCommerce has been around since March 2000. At present there are over 10,000 live, registered osCommerce sites, and about 100,000 registered community members. Apart from providing ready-made solutions to problems, as well as a huge repository of information, the osCommerce community is a living entity with which we can all interact. With the rising success and popularity of this remarkable piece of software, things can only get better.
Table of Contents (17 chapters)
Deep Inside osCommerce: The Cookbook
Credits
Foreword
About the Author
About the Reviewers
Introduction

Introduction

Dear fellow osCommerce community members, what’s for dinner tonight?

Your good old stew recipe probably doesn’t sound that appetizing anymore, and your customers probably share this view when they visit your website that hasn’t been spiced up recently for added interest.

Let’s whip up in our cuisine a donation module for that church, which prefers to collect alms not only during servicess, but also online these days. You may be an artist in need of an online showroom presenting courses, tutorials, and artwork in a content management system, with or without an added shopping-cart function as its backbone. Why not garnish your gift shop with a great solution for offering gift-wrapping choices during checkout.

osCommerce is a highly adaptable, fascinating piece of software that already offers most necessary ingredients to work with; yet you can compare it with a five-star restaurant where the secret trimmings and preparations make the unrivaled dishes.

Make your store truly yours by adding that special kick, which makes it stand out from the crowd of online shops. Just as you are willing to spend a dime on a fabulous five-star dinner prepared by the chef, you will find that your customers feel the same way, as your shop wins their favor due to your new custom code that enhances their shopping experience. Increased sales rates will show you just how much they really like those new treats.

With this book in your hands, you will find many inspiring ideas that will make you itch to dive into your code pages immediately. Some are only a few lines worth, some go knee-deep into core code changes, while others involve minor tackling of a lot of files with incredible outcomes. All will add that special flavor to your site that you have been looking for.

This step-by-step presentation of each tastefully prepared recipe will allow you to pick modules that you have always wanted to implement to finish off your store.

Your files are your ingredients; your brain is your equipment; add a bit of elbow grease, and your customers will be delighted to see the mouthwatering treats you cook up for them.

Just as a great cook can whip up an entire menu after a spoonful of that new gravy in his favorite restaurant, you too will be inspired to make changes similar to those in this book. You’ll learn about code reading and the great pleasure of making that code yours. While I suggest making most changes manually, you can request a file set of each recipe from Packt’s website by presenting a proof of purchase of this book. This will definitely come in handy with larger bits of code, when typing it all again could become messy.

But who cares about a bit of mess? Get out your apron and roll up your sleeves, and Bon appetit!

What This Book Covers

Chapter 1 equips you with a few, very easy, and very important changes to the basic design, which will make developing, and later modifying a whole new template a breeze.

Chapter 2 will help you modify your navigation to ensure a smoother shopping experience for your customers.

Chapter 3 covers infoboxes, and turns you into an expert in tweaking them to your needs.

Chapter 4 deals with one of the most important visual parts of your shop—the product display in the listings and the detail page.

Chapter 5 outlines different methods to make searching on your site a fun experience since you want your customers to use your search and to find the products you want to sell to them.

Chapter 6 highlights customizations of the checkout process, namely, the flow from the shopping cart to the shipping and payment pages up to the order email.

Chapter 7 talks about new shipping modules. You will learn how to adapt existing modules to create completely new rate systems for your shop.

Chapter 8 focuses on existing payment modules and how they can be tweaked.

Chapter 9 provides tips on efficiently using banners as a marketing tool.

Chapter 10 is a goody bag of extra special treats to indulge your sweet tooth.

Chapter 11 tackles changes in the admin area. You alone will be the keeper of these secret recipes hidden to the public eye.

What You Need for This Book

This book is for people who are already familiar with osCommerce. It presumes a working knowledge of PHP and HTML, as well as basic understanding of phpMyAdmin for database inserts.

How to Use This Book

As with any good cookbook, you can open this book in any chapter and start with the recipe that tantalizes your taste buds first. There is no need to first read the book cover to cover, as all individual recipes work as standalone modules to spice up your default osCommerce installation to suit your taste.

All recipes are sorted by topics into chapters and can be implemented in any order. Each recipe starts out with an osCommerce 2.2 Milestone 2 Update 060817, which has the latest security patches of August 2006 added to the core code. If you are using several recipes, make sure you mix and match carefully, so you won’t break the code. Always take a backup of the files modified. For easier identification, mark the header part of the file with the recipe you are using in it.

Conventions

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: "Run the following SQL statement in your database to create the new columns affiliate and affiliate_url for the products table."

A block of code will be set as follows:

// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from
" . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" .
(int)$current_category_id . "'");

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$cPath_array = explode('_', $cPath);
$stylesheet_test = $cPath_array[0];
include(DIR_WS_MODULES . 'cat_driven_stylesheets.php');

$categories_products_query = tep_db_query("select count(*) as total
from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" .
(int)$current_category_id . "'");
}

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

Note

This sticky note box appears at the start of all recipes, and will tell you which ingredients to have ready before you get cooking.

Note

To make sure that your soup doesn't get too salty or burned, special tips are highlighted as Chef's suggestion in this format.

Reader Feedback

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

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.

Customer Support

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.

Downloading the Example Code for the Book

To obtain the code for this book, send a mail to. Your order will be verified and the code dispatched via email"

Errata

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 Submit Errata link, and entering the details of your errata. Once your errata have been verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

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.