Oct 29 2008

Is Magento Commerce the new Joomla?

If you are in the open source eCommerce industry, you probably heard about the new kid around the block: Magento Commerce. If you follow the industry news, you know that since its announcement back in April of 2007, Magento’s popularity is nothing shy of sky rocketing. Certainly feels like mid-2005 with the emergence of Joomla and the demise of Mambo in the CMS space. So, what makes this open source ecommerce platform so popular? What is it still lacking, but seem unimportant? First, we can clearly see an obvious trend: the emergence of Magento and the decline of both Zen Cart and osCommerce:

Search trends for the terms Zen Cart, osCommerce, and Magento

Search trends for the terms Zen Cart, osCommerce, and Magento

The notion of ecommerce built from the ground up with today’s modern tools gives shopping cart owners a warm  fuzzy feeling. Top it with the fact that the modern tools are solid MVC (Model View Controller) design pattern and the Zend Framework and you get a bunch of online stores that are ready to jump on this promising bandwagon. Ok, I am missing one important fact! These days, admit it or not, looks and coolness are gold. Not surprisingly, this is were Magento shines!

But wait a minute, is Magento Commerce ready for prime time? Well, this is where you see a divide in the industry, this is where the chasm and the bell curve comes in. Yes, Magento does lack performance, stability, scalability, and some trivial features that existed for many years in other carts like Zen Cart and osCommerce. But the trend is obvious and there is no going back. If history repeats itself Magento will become a leader very very soon!

Viva la competicion!

One response so far

Sep 22 2008

ZenCart and Magento for eCommerce

Anyone who is involved with an online shopping cart and was considering open source solutions probably stumbled upon two major ecommerce providers: ZenCart and Magento Commerce. ZenCart is an evolving and older shopping cart with roots in osCommerce, while Magento Commerce is a newcomer to this category written from scratch on top of the new Zend Framework. Since we support both platforms, we often are asked to provide a basic comparison analysis for the business owners and this is what I will try to do in this article.

ZenCart

This is a great open source shopping cart that can power almost any size eCommerce sites. We have successfully used ZenCart for sites offering 20 products all the way up to tens of thausands of products and variations (which by the way is connected to a POS and kept up to date to the minute). Since its fork from osCommerce ZenCart has gone through extensive development and now offers much broader extendability and robust template system. Some of the underlying systems that make this shopping cart so robust are: template system, initialization system, object autoloaders, plugins a-la observer design patern, flexible and extendible configuration system, and more.

One of the biggest disadvantages for ZenCart is that all these great systems were built on top and in an after thought to an existing platform. Hence, there are many dependencies and the learning curve for professional grade customization and development is steep. For example, one of the tasks that current core developers are working on is to transform additional funcitons to object oriented design, in other words, they are still trying to get rid of the spagheti code left from the osCommerce days.

Nevertheless, ZenCart is a true workhorse that has proven itself many times and with hundreads of thausands of stores world wide. In fact, it has excellent support for multiple languages and multiple currencies stores.

At Activo, Inc. we have developed many modules to enhance various aspects of the store: front end, specialized templates, taxes by zipcode, easy search suggestion tool, even a real QuickBooks integration module and a real time Point of Sale (POS) integration with RunIt systems.

One more thing that ZenCart excels in when the right modules and the right setup is applied is SEO (Search Engine Optimization). Once setup correctly, ZenCart is one of the most SEO friendly stores out there. I have seen multiple times where a brand new ZenCart store with some SEO efforts generating more than $50,000 per month in sales (within 2-3 months of Go-Live).

ZenCart bottom line: Great solution if you want to see a solid and proven shopping cart with mostly standard features and you do not care about the type of technology that powers it. Currently, for best and fastest deployment ZenCart is second to none.

Magento

Magento is a brand new (about a year old as of writing this article) and it is now beginning to see community and developer adoption. Magento is written on top of PHP5 and Zend Framework. A bit about the framework: the new Zend Framework is sponsored by industry leaders such as IBM and Zend and is largely based on the MVC design patern. In a way, it is the answer to the .NET framework in the PHP world. There are similar frameworks and they may even be older and more mature, like Symphony or CakePHP. However, since the Zend Framework is backed by both IBM and Zend it is very likely that this framework will become the industry standard.

Magento was developed from scratch and in an object oriented manner on top of the new Zend Framework. Therefore, it is expected to have better extendibility options for developers and much better module/plugin management consules in the back-end however will probably come at the expense of instability in the short term. Magento’s templates out of the box look sharp and eye candy. Its creator definitely placed an emphasis on the way it’s admin panel feels & looks and the way its demo templates look & feel. Additionally, almost all aspects of the UI feels a lot more like Web 2.0 with many AJAX features and many time saving UI features.

One of the biggest downsides to Magento is its current speed since it lacks an effort in optimizing its DB and overall structure. Hence, it is relatively heavy and requires a bit of advanced know-how when installing and setting it up. It’s forums seem to be gaining traction with developers and many developers say that once you migrate a store to Magento you will never look back.

Magento bottom line: While it is definitely a matter of time until we see the real value, Magento does seem to have some advantages over any other open source eCommerce system. Merely the fact that it was developed from scratch recently means that a whole lot of best practices are thought of right of the bat instead of showing as an after thought (which we as developers have to deal with it). Nevertheless, Magento’s forums indicate that the product has yet to have reached maturity. If you are ok with somewhat unstable solution and looking for the absolute cutting edge shopping cart Magento is for you!

2 responses so far

Aug 25 2008

Looking Ahead: ZenCart ver 1.4

The ZenCart developer team seems to be hard at work and preparing to deliver a new version of ZenCart: ver 1.4. The core developers posted a roadmap brief for version 1.4 back in September of 2007. Recently, additional entries have been posted in the forums describing in more detail the upcoming changes and signaling a new release is to be expected soon.

The currently described updates to ZenCart are done all around the DB, its architecture, and improving its performance. To summarise from the ZenCart forums:

New Database Driver Layer
Extremely light/flexible drivers make it easier to support other Database Types
Preliminary support for innodb and mysql transactions

Sql Caching system rewritten
Much easier to add new caching types
Preliminary Support for Memcache

Use of MPTT for category structure
Reduces number of queries needed to ‘describe’ the category structure
Improves user experience thru reduced page load times

Supporting Classes to reduce query load
Hugely reduces queries needed
Reuses queries using Cache to further improve performance

The roadmap for ZenCart ver 1.4 promises the following updates to the code (summarized):

  • Better usage of PHP 5.2 features. This also means 5.2 will be the new minimum requirement.
  • More Object Oriented code, less of the old osCommerce code.
  • Lots of DB improvements (some is described above, seems more is yet to come).
  • Category structure converted to MPTT format. MPTT stands for Modified Preorder Tree Traversal (explanation of MPTT).
  • Performance improvements for sites with lots of product attributes.
  • More function libraries converted to classes.
  • Duplicate components shared between admin and catalog.
  • Template system enhancements: less tables and more admin control.
  • Additional notifiers for the observer system.
  • Transaction support with InnoDB. Also mentioned as initial stage according to the recent posts of the updates that were done so far.
  • SwiftMailer instead of phpMailer.
  • Stock and SKU per product attribute.
  • Security enhancements.

Keep up the good work!

2 responses so far

Aug 21 2008

Authorize.net changes Transaction ID field - ZenCart passes tests

Just a quick note that Authorize.net will be upping the limit on the transaction id field. Apperently, they are close to reaching the limit of the field type, so they are adding digits to the field - we are talking about some really big numbers! ZenCart seems to have acknowledged the news and tested their latest stable release. On ZenCart’s end, all seems to be ok except a small DB change that will only affect shops that choose to store the transactions over time. Hence a quick fix is posted on ZenCart’s forum.

This also means that all plugins, modules, or any Authorize.net integration scripts need to be tested. This change will probably not be a make or break for any code that integrates with Authorize.net APIs, but it is worth verifying your code and your shopping cart just in case.

Originally Posted by Authorize.net:

What is going on with the Transaction ID field?
The Transaction ID field was originally developed with a maximum numeric value of 2,147,483,647. As the number of merchants using the Authorize.Net Payment Gateway has grown, we have identified a time in the near future in which the Transaction ID count will surpass 2,147,483,647. For this reason, we are in the process of expanding the range of Transaction IDs that the payment gateway can issue. Accordingly, we are communicating to all Authorize.Net merchants to verify that your systems can accommodate a 10-digit Transaction ID greater than 2,147,483,647.

No responses yet

May 26 2008

ZenCart: Develop an Advanced Plugin Without Overwriting Core Files

At Activo, Inc. we have a few products that integrate between ZenCart and other systems. Recently, we went through the exercise of rewriting our Activo ZenCart POS (RunIt) Integration plugin so it will not require overwriting any core files. It took some time to read and research the ZenCart’s best practices and to follow the documentation, however once we learned what is available and how to use it, converting the code was a breeze. Our previous version of the plugin included already some usage of the flexibility of ZenCart but to complete the abstraction we needed to use the initSystem and the Observer Class.

Making sure that your plugin does not override any other core files or doesn’t require tweaking any core files is important for several reasons. First, overriding core files prevents smooth upgrades - it doesn’t matter how small of a change you introduced once upgraded you will always have to reintroduce the change. Second, a plugin that does not override core files have better chances (95%+) that it will interact smoothly with other non-obtrusive plugins. Third, respecting the platform’s API extends the life of your plugin over several versions of the platform that it plugins to. The following four different methods or subsystems are available for writing efficient and non obtrusive plugins within ZenCart:

Template Override Mechanism

This is the most common way of modifying your own shopping cart and making it stand out from other ZenCart systems. I believe the template override system was introduced right after ZenCart was span off of osCommerce. While, the current templating system is not my favorite (Joomla CMS has a much better template system), it does introduce all the flexibility that one needs in order to generate a custom template in ZenCart. At Activo, we have developed several shopping carts that do not resemble a typical ZenCart site. Here is how:

  • look under the /includes/templates folder - you will find the two templates that ship with every ZenCart: ‘default_template’ and ‘classic’. To add your own template, create a new folder try to use related name to your site or store and make sure to follow linux web folder naming conventions as this folder will be used for every CSS, Image, or Javascript files on your site.
  • Add the description file to your newly created template folder. This file will allow some information to be displayed in the admin area of ZenCart under Admin > Tools > Templates.
  • You probably want to add a jpeg or gif screenshot image of your template front end, however this is optional. If you do, don’t forget to place it in /includes/templates/<Your Template Folder>/images and put the name of the file inside the ‘template_info.php’ file in the ‘$template_screenshot’ variable.
  • At this point you have a template that will display everything exactly as the default_template because each file that cannot be found under your newly created template folder, ZenCart will look for the same file under the ‘default_template’ folder. So, to custromize just copy one file at a time from the default_template folder and begin customizing.

Note there is a lot more to this templating system than the files that you can override under the custom template folder. This will require its own article altogether.

‘extra’ Files Automatic Inclusion

If you spend enough time looking around the ZenCart folder, you will find a few folders that start with the words ‘extra_’. Any PHP files under these will run through execution before any page loads. The main purpose of these folders however, is to include definitions or init values necessary for some modules or components that you install or that you are writing. Since these folders run before anything ‘interesting’ happens with ZenCart, it won’t help to run scripts here. Similarly you will find ‘extra_*’ folders under the /admin/includes and some additional all around the site with more specific purposes, here is the full list with a small description for each one:

  • /admin/includes/boxes/extra_boxes - Extra submenu items for anything but the first column of the admin menu.
  • /admin/includes/extra_configures - Configurations files for admin panel plugins.
  • /admin/includes/extra_datafiles - Data files and data file definitions for the admin panel plugins.
  • /admin/includes/functions/extra_functions - Additional function files. These functions will be declared globally in the admin panel and can be used form your plugins.
  • /includes/extra_cart_actions - Custom shopping cart actions. Special logic to the shopping cart.
  • /includes/extra_configures - Configuration files which will be included in the front end.
  • /includes/extra_datafiles - Data files and data file definitions for the front end plugins.
  • /includes/functions/extra_functions - Additional function files. These functions will be declared globally in the front end and can be used form your plugins.

initSystem

The initSystem of ZenCart is an extendable system that allows programmers to define what happens on initialization while remaining within the ZenCart framework. In simple words: it lets a programmer set your plugin environment in any way, shape, or form without rewriting the ‘application_top.php’ file. From the wiki page directly:

The term initSystem, apart from being a tag used to group certain PHP files together in the new documentation, is meant to embrace all of those files that are automatically included/initialised before any ‘command’ scripts can be run.

Zen Cartâ„¢ uses a (non Object Oriented) page controller pattern to decide the scripts to run, based on HTTP_GET parameters. The most important of these is the ‘main_page’ HTTP_GET parameter. Depending on that parameter, a command script is then run. Each commmand script resides in a directory in /includes/modules/pages.

The essence of how to use it is well described in the wiki page. What’s nice here is that ZenCart’s own internals make use of this system and you can see it under the ‘init_includes’ folder. It is fairly easy to add your own init script files and extend ZenCart to fit your needs. Make sure to read all of the documentation on the wiki page since there are some easy-to-overlook pitfalls like file name conventions and the order of which things happen in this system.

Observer Class

The Observer Class system of ZenCart is a sophisticated way to avoid core hacks in common places. It is a design pattern that is being used a lot in operating systems, and GUI design. It introduces a notion of events. A set of global events is declared throughout the ZenCart system and you can define your own logic or set of tasks that can be invoked by attaching your class to a specific event or a set of events. The list of events is pretty vast with the latest version of ZenCart (ver 1.3.8a) and can be seen at the wiki page for this system.

Conclusion

The above four methods of customizing and extending ZenCart is all that a good programmer needs in order to develop a robust, scalable, modular, and secure shopping cart website. These systems do not exist in osCommerce or any other open source shopping cart systems out there, at least not at the same level of maturity.

Enjoy!

Resources:

One response so far