Archive

Posts Tagged ‘ZenCart’

ZenCart 1.3.8 and PHP 5.2.11 Bug: problem login to admin area

October 15th, 2009

Yes, I do have some clients that still use ZenCart. In fact, some ZenCart stores are doing very well in terms of SEO and more importantly, sales. This morning, I ran a routine yum update command on one of my clients servers. To my surprise, after rebooting the admin was inaccessible. I’ll share with you the symptoms so you can identify it and the solution that worked for me.

zencart-1.3.8-php-5.2.11-bug

The symptoms:

  1. Not able to login to Admin panel. More importantly, when you try to login it doesn’t show any error message.
  2. No admin is able to login, in other words, the problem is global.
  3. If you look in the php log files, you’ll find a similar line:
    PHP Fatal error:  Class ‘queryFactory’ not found in /var/www/html/includes/functions/sessions.php on line 54, referer: http://www.securepersonalcare.com/admin/login.php

What is happening:

While I am not sure exactly, this post in the ZenCart forums gave up a clue: it was something in PHP 5.2.11. Now, it may be a new bug in this new version or a bug that got resolved and as a result it broke something in the old ZenCart. Note that as of this writing, ZenCart 1.3.8 is about a year and nine months old. In internet time this is a significant amount of time.

The solution that

Once I had an assumption for what the problem is, I worked on reverting the PHP version to an older one. However, when I tried to revert using the Atomic repository – it did not work because while they do make old versions of php available, the php-common is not. I ended up removing the atomic repository and using CentOS repositories which provide PHP ver 5.1.6 something. Reinstalled, restarted apache, and vuala!

Now, only if the ZenCart team will get off their butts (or maybe get on their butts) and finish up what they call the next release of this eCommerce application!! What is the next version 1.4, 1.6, 2.0, 2.5? of ZenCart, well that is another discussion altogether.

ZenCart , ,

The Case for ZenCart: Supporting the Long Tail of eCommerce

June 18th, 2009

While Zen-Cart is one of the best open source ecommerce platforms it has plenty of deficiencies, however I recently understood that it will always be able to keep its niche and therefore always have a market.  Of-course this will remain the case as long as its leaders remain true to its spirit.

the_long_tail_of_open_source_ecommerce_platforms

Zen-Cart is an unwilling offspring of the popular osCommerce. Like all offsprings, it is an improved version of its predecessor with better templating system, class oriented design, and notification systems but still maintains its characteristics of spaghetti code and somewhat convoluted and non-flexible checkout process.

Zen-Cart’s strengths are its simplicity which gives many non-programmers the opportunity to tweak and add (or remove) features to their likings with no major effort. This means that implementing a Zen-Cart ecommerce website is usually inexpensive and fast. Another great benefit of the system’s simplicity is speed. Zen-Cart is many times lighter than many other ecommerce systems even without complex caching technologies. Together, these benefits support a specific market: the market of light ecommerce. I am talking about online shops with 1 to 100 daily transactions or even less. It can obviously support more than that but the simplicity and the light weight features will attract the small business which is budget oriented.

The light ecommerce market while being small in terms of overall sales figures is relatively large and will get larger and larger with time. This is also known as the long tail of any market, in our case it is the long tail of the ecommerce market. This means that the numbers of installations will most likely be large and not insignificant. It also means that it is a valid market and will not vanish overnight with any other solution such as Magento who now charges a hefty amount for licensing its Enterprise version.

Before you rush to declare this light and feature packed ecommerce platform the kind of the long tail ecommerce market, don’t underestimate the challenges that it is facing. With over a year and a half of no significant updates its market share is shrinking fast. The default template and the admin panel need some serious reworkings to get up to par in UI and design with other open source challengers and a major cleanup and reorganization of the backend configurations is way overdue. While it supports XHTML and validates correctly, the default template needs to be reworked without the tables.

In any case, Zen-Cart still serves its purpose as a free and light open source ecommerce platform. And here at Activo we have recently developed a Recurring Orders payment module that comply with PCI requirements and integrates well into the ARB module of Authorize.net. I’ll soon post links to an initial free version, a commercially licensed version should be available in about a month or so.

What do you think of ZenCart? here to stay or yet another open source project that will be lost in oblivion? somewhere in the middle perhaps?

eCommerce, Magento, Web Development, ZenCart , , ,

ZenCart and Magento for eCommerce

September 22nd, 2008

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!

eCommerce, Magento, PHP/MySQL, Web Development, ZenCart , , , , , , , , , , ,

3 Steps to Increase Your Website’s Traffic with Popular Keywords

September 21st, 2008
Comments Off

These days it is all about SEO (Search Engine Optimization) and SEM (Search Engine Marketing). Especially now with the financial and real estate markets in turmoil, businesses seek to conserve resources and perhaps try the alternative to online advertising; seo with keyword targeting.

Keywords from A Tweeter User (Tweeterstats.com)

The following three steps will help you refine content based on a list of selected keywords:

1. List Targeted Keywords

Make a small list (5-15 keywords) of keywords that relate to your industry. Only you will actually know what keywords relate best to your business and services. What you want to remember is to list keywords that you assume your target audience will search for not necessarily keywords that describe your services directly. Notice that keywords can also be key phrases, meaning 2 or 3 keywords that are joined together into a phrase.

2. Refine the List of Targeted Keywords to Targeted and Popular Keywords

Use one of the following free services (or all of them) to refine your list:

These free tools give you a list of related keywords and key phrases with the relevant popularity and lots of other statistics. For example, we provide services for clients who power their ecommerce sites with ZenCart. I typed ‘zencart’ into Google Adwords Keyword Tool and it shows that some of the most popular key phrases are ‘zencart hosting’ and ‘zencart templates’. As a result, pages that relate to ZenCart should have these key phrases in the text. Perhaps I will separate the zencart list of keywords from the rest of the keywords, etc.

3. Develop Content Based on Targeted Keywords

Now that we have a list of refined keywords, it is time to do something about it. Develop or refine your content around these keywords.

Of-course in each website there will be a hit or a miss. Keep exploring for new keywords on a regular basis and make sure to keep tracking the results or any changes that occur as a result of your refined content.

Do you want to share your methods of achieving high levels of targeted traffic?

Search Engine Optimization (SEO), Web Development, ZenCart , , ,

Looking Ahead: ZenCart ver 1.4

August 25th, 2008

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!

eCommerce, PHP/MySQL, Web Development, ZenCart , , , , , , , ,

Authorize.net changes Transaction ID field – ZenCart passes tests

August 21st, 2008
Comments Off

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.

eCommerce, Web Development, ZenCart , , ,

ZenCart: Develop an Advanced Plugin Without Overwriting Core Files

May 26th, 2008

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:

eCommerce, PHP/MySQL, Web Development, ZenCart , , , , , , , , , ,