modifying osCommerce [part 1- orientation]

This is part one of a three part series of posts I’m doing about osCommerce (osC) modification. The purpose of this article is to provide and overview of the software at the file level so that anyone needing to address osC in modification/troubleshooting has an idea of where to look.

About osCommerce:

osCommerce is a free storefront web application written in PHP. It offers a variety of setup options, but as the case with almost any store there will be very specific business needs that need to be addressed.

Avoid osCommerce if you can

“Out of the Box” Shopping Cart software generally sucks. If you’re posed with the question of “should I use a prepackaged store or just write my own?” definitely write your own according to your business objectives.

However, if you’re forced into using something out of the box—you’ll need to know how to modify the software. Modifying code that other people wrote is generally tedious, especially if the software is written rather creatively and not exactly well documented.

My Experience

Recently I was charged with salvaging a project that involved osCommerce and I’m going to write a guide that I wish I had the first day in hopes of saving someone else a ton of time. The most involved I got with osCommerce was modifying the shopping cart and checkout process so that customers could select varying shipping addresses for the same order. Almost all of my modifications were made to the checkout process and with the product info/add to cart screen.

The important files

  • includes/application_top.php – quite possibly the most important file in osC. application_top serves as the “brain” of the entire suite. The file is loaded on every page and does decision-making as to which files/functions are called/loaded thereafter.
  • includes/classes/shopping_cart.php – if you’re going to be customizing osCommerce at a product level (for instance, adding product specific shipping addresses) you will want to look at the functions in this file.
  • includes/classes/order.php – storing the product-specific modifications with your orders would be done here.
  • includes/classes/modules/payment/authorizenetaim.php – All of our Authorize.NET capturing and processing was done in authorizenetaim.php.
  • includes/configure.php – changing from a development/production server would be taken care of here. osC is particular about this file’s permissions (chmod 666)
  • shopping_cart.php – the display of the shopping cart object (from includes/classes/shopping_cart.php) is taken care of in shopping_cart.php.
  • checkout_shipping.php – I ended up completely rewriting this file. Selecting shipping addresses for the order is taken care of with checkout_shipping.php.
  • checkout_confirm.php – an order confirmation screen. Transformation from $cart object to $order object happens with checkout_confirm.php.
  • checkout_process.php – order processing happens within checkout_process.php. For larger stores that already have shipping/packing systems, there will have to be some obvious modifications to checkout_process. This file also sends the warm ‘n fuzzy email order confirmation.
  • checkout_success.php – screen that provides an order number and is the point of conversion for analytics.
  • includes/footer.php – useful for adding sitewide analytics, like Google Analytics. Be forewarned, using SSL you’ll have to do some detection. I’ll show how this is done in another article.
  • product_info.php – displays product information (!!!); modification of this file will be useful if you’re adding product specific attributes that aren’t built in to osC.

“Y’know, there’s a better way…”

osC has product attributes built in to the administration. The software is very customizable from the administration interface. However, the admin interface (and several community modifications) did not come close to meeting our needs so I had to dive into the code. I think my story is very similar to a lot of past, present and future osC users.

Where’s the rest?

The two other parts to the series of articles on osCommerce are coming. They are going to deal with specific modifications (part 2-functions, cases, blocks oh my) and analysis (part 3-analysis, finding ROI for your store). I’ll have them out soon. Life’s a bit hectic these days.

Advertisements

About andyhillky
I'm cool.

5 Responses to modifying osCommerce [part 1- orientation]

  1. TellitSlant says:

    It’s not us, it’s you. You need your space. You’re not ready for something so serious. Heard it all before. Just admit it! You’re only going for the sweet tea and warm weather!

  2. Adam says:

    Peachtree City is calling your name…I can hear it

  3. Kate says:

    What about Chipotle?

  4. Kristin says:

    Glad to see you’re comming back our way! Hope you bring your cribbage board with you 😉

%d bloggers like this: