Magento vs X-Cart

Saw this article today, and haven’t posted up here in awhile, thought I would share the article and my comments (currently pending) here for others as well.

arrow http://expertmagentodevelopers.wordpress.com/magento-vs-xcart/

While I agree with most of the article, having used both systems extensively I wanted to share a few of my own personal opinions on X-Cart and Magento.

  • Varian is now Magento, Inc. which is now owned by Ebay.
  • X-Cart is NOT OOP and is VERY difficult to follow an upgrade path when new releases come out, this was my biggest reason for switching to Magento after having many Clients with X-Cart and spending countless hours just to upgrade a client to the latest X-Cart release.
  • Magento is a very complex system (almost overly engineered) but after spending enough time with it, it starts to make sense why this is the case, and how its easy to rapid prototype client requested features without FUBAR’ing the upgrade path.
  • You are also correct on Magento being slow, it uses a huge amount of abstraction layers, ORM, EAV data models to make it easy to extend both on the Client side and Programmers side. This is where I would say X-Cart wins because of its procedural code if speed is your only consideration. However, for example, adding a new multi-option drop down on a product is far more cumbersome in X-Cart than in Magento.
  • I would disagree on the documentation for Magento, there forums aren’t very helpful however StackOverflow and people like Alan Storm, Inchoo, etc. really help in understanding Magento easier.
  • Smarty templates are just overhead IMO, simply doing PHP wrapped in HTML like Magento does makes sense from a performance stand point, most designers/FEDs are going to have to learn one or the other either way and it doesn’t separate business logic from presentation very well either.

Conclusion: I am by no means saying X-Cart is a horrible E-Commerce package, it works very well and has/had served many of my clients well. However if a client doesn’t have many new features, doesn’t care about upgrade paths and wants a cheap reliable hosting that is responsive. X-Cart is the way to go. If you are wanting a robust E-Commerce system that can grow with your business easily, and you have lots of time, money and programming resource at your disposal Magento is the best choice. I know that statement sounds like Magento is just a money/time waster. It is not as your investing in your companies future more so with Magento than, X-Cart. That being said, for small shops that want a similar route to X-Cart now have the Magento Go! option as an affordable SaaS solution to get an E-Commerce store up and running without having hardly any programming, design and/or e-commerce experience.

Magento version 2.0 (X.Commerce) and eBay

eBay Acquisition

the bad(maybe?) news.

As everyone may know for the most part, eBay now owns Magento. (at least the details are still being worked out, currently.)

Overall I’ve seen some mixed feelings in regards to this, I myself am pretty up in the air; if it’s a good or bad thing, and I think the only thing that will tell is time.

With all the talk, I’m suspecting a fork or two will show up of Magento granted if the OSL will allow for such which I’m pretty sure it will, long as its made freely available:

arrow Magento Community to Enterprise version when its open source?

With that said, during the developers paradise there was mention that eBay’s X.Commerce package would in fact be “Open Source”.

Related Links:
arrow Inchoo on the acquisition

[warning]…when deep-space exploitation ramps up, it will probably be the megatonic corporations that discover all the new planets and map them. The IBM Stellar Sphere. The Philip Morris Galaxy. Planet Denny’s. Every planet will take on the corporate identity of whoever rapes it first. Budweiser World. ~Chuck Palahniuk, Fight Club, Chapter 23[/warning]

Magento 2.0

the good news.

The most interesting news was information about a 2.0 version of Magento, I’m going to assume this will be under the new name X.Commerce with eBay ownership. It will NOT be backward compatible with 1.0 and is NOT a rewrite but a refactoring. It is due to release around the middle/end of this year.

The list of new shinny exciting things:

  • eregi_replace(“^(.*).js$”,”prototype.js”,”jQuery.js”); // No more Prototype!
  • PHP5.3 Native.
  • Simpler file structure, no more app/etc/modules I believe.
  • GUI Design Editor (WYSIWYG?)
  • Class Mapping: No more searching 3 directories of code pools.
  • EAV can be optional (for performance I presume).
  • A deeper theme fallback support.
  • Unit Testing, Selenium, TDD Support.
  • Staging before applying any core updates/modules.
  • Better server side validation.
  • More database options: Oracle, MSSQL, PostgreSQL, etc.
  • No more Magic getter/setters.
  • More API options: RPC/REST
  • Name space collisions detection with advice on how to resolve dependencies.

Related Links:
arrow Magento 2 (in German)

Magento Supercharged Development Tools and Links

So I’ve been doing some reading up and researching on Magento lately, and found some links to articles and tools I think may be useful, so I’m sharing them with everyone. Enjoy!

Credits: A lot of these projects and articles are courtesy of these well known names in the Magento Community: Colin Mollenhour, Ashley Schroder, Alan Storm and Unirgy (Boris Gurvich).

Module Manager:
Creates symlinks between a mapped out file similar to a Makefile in Linux compiling that will create links where they need to be installed from the CLI via symlink making it easy to deploy and uninstall modules in Magento without touching the Core. It’s also Git friendly.
satellite http://code.google.com/p/module-manager/

Module Manager for when svn:externals just doesn’t cut it:
How Module Manager can be used instead of svn:externals.
satellite http://colin.mollenhour.com/2009/10/17/module-manager-for-when-svnexternals-just-doesnt-cut-it/

Magento Debug tool similar to Alan Storms ecommerce Bug:
Debug Tool with some nifty features – requires modman to install at the moment.
satellite Now Available on Magento Connect.
satellite https://github.com/madalinoprea/magneto-debug

MongoDB abstraction layer for Magento:
MongoDB is an open source Database that’s high performance, schema-free, document-oriented, with JSON encoded outputs. This is an abstraction layer for using MongoDB with Magento instead of MySQL.
satellite http://github.com/colinmollenhour/magento-mongo

uScaffold rapid prototyping modules:
Scaffolding is pretty common amongst Rails developers it’s a means of building a skeleton shell of a module based on some parameters.
satellite http://unirgy.com/wiki/uscaffold?#uscaffold

Magento Design Patterns:
A list of design patterns that Magento currently utilizes:
satellite http://stackoverflow.com/questions/5041473/magento-design-patterns

Alan storms Configuration Lint:
XML Configuration verification script, does a “light” job and isn’t extensive.
satellite http://alanstorm.com/magento_config_lint

Magentos API with SOAP:
Quick read article to get you using Magentos API via SOAP, with some details on WHERE clauses, setup, etc.
satellite http://www.yireo.com/tutorials/magento/magento-programming/629-connecting-to-magento-with-soap-part-1

CSS3 + HTML5 Boiler Plate for Magento:
HTML5 Boiler Plate on CSS3 For Magento, starting point for Magento Themes.
satellite http://zeljkoprsa.com/magento-boilerplate-with-css3pie/

Speed testing for Magento with Seige:
Uses Seige to test a sites Magento speed (requires sitemap.xml)
satellite http://www.magespeedtest.com/

Magento Development environments & deployment Ideas/tips:
The comments Kristof Fooman and Colin make are also good to read.
satellite http://www.aschroder.com/2010/07/structuring-your-magento-project-for-engineering-not-hacking/

Book Review: Magento 1.4 Themes Design by PacktLib

After reading and reviewing PacktLib’s Magento 1.4 Cookbook, I decided to give this book about Magento themes a day in court.

Pros:

It does a very good job of walking someone through the entire process of building out a theme from almost scratch. Doing a very good job of describing Magento’s terminology for its hierarchy of websites, stores and views with many visual cues to get a general sense of how and why Magento’s theming is built in this manner. It also does a very good job explaining Magento’s fall back methodology for template/theme files, even noting the differences from versions 1.3 to 1.4. This book would definitely help a newbie at getting started producing their own themes for Magento.

Cons:

With the ever changing landscape of software to hard copy books, the books are almost always months behind official releases. The review of simple CSS/HTML changes like font @font-face while relevant really has not a whole lot of bearing on Magento’s themes and these topics should be lightly touched on as they are not integral parts of the Magento theming system. Also with the previous the first chapter starts with installing Magento and general usage. While this may be relevant to a newbie, it will bore even Novice Magento developers, skip these chapter(s). Lightly touching on the layout XML configurations that is Magento, I would recommend also reading Alan Storm’s No Frills Layout book for more in depth knowledge.

Conclusion:

Overall my impressions of the book appeared it really wouldn’t contain much information most seasoned Magento developers or theme designers won’t already know. It is really geared for a UI/UX Developer who’s just got Magento dropped on their lap or they are wanting to get their feet wet in using Magento themes.

Overall my rating would be 4 out 5 stars:

To pick up a copy of your own both Hard and Electronic:
arrow Magento 1.4 Themes Design.

Magento modules post deployment uninstall & downgrading

An interesting question on StackOverflow about Magento modules and the un-installation or downgrade of code…

[box]Automated instant rollback is an important feature of enterprise-grade deployment mechanisms. Currently, it’s not possible to achieve this using Magento’s built-in installation tools. Given that Magento’s core_resource mechanism allows for the sequential execution of setup scripts for installation or upgrade of modules (via execution of SQL and also PHP), it seems logical that it should support the same process in reverse.[/box]

I have seen some postings in regards to such and have investigated the same scenarios for SQL deployment myself. I would have to agree that being Enterprise grade Magento should have this type of functionality built-in. The good news it IS, at least in SOME form or fashion, how complete it is I’m not really sure. Here’s a sample of a rollback upon exception:

    try {
        $write = Mage::getSingleton('core/resource')->getConnection('core_write');
        $write->beginTransaction();
    // do stuff here
        $write->commit();
    } catch (Exception $e) {
        mage::log(__METHOD__ . ':' . __LINE__ . ': Rollback happened.');
        $write->rollback();
    }

Now if you take a look at app/code/core/Mage/Core/Model/Resource/Setup.php you’ll find quite a bit of interesting methods. In particular: _getModifySqlFiles, _rollbackResourceDb and _modifyResourceDb.

_modifyResourceDb is the most interesting to me, since the $actionType here can be rollback and uninstall as well – also note you can use PHP files for your setup files as well.

    // Read resource files
    $arrAvailableFiles = array();
    $sqlDir = dir($sqlFilesDir);
    while (false !== ($sqlFile = $sqlDir->read())) {
        $matches = array();
        if (preg_match('#^'.$resModel.'-'.$actionType.'-(.*)\.(sql|php)$#i', $sqlFile, $matches)) {
            $arrAvailableFiles[$matches[1]] = $sqlFile;
        }
    }

After this code executes:

    $arrModifyFiles = $this->_getModifySqlFiles($actionType, $fromVersion, $toVersion, $arrAvailableFiles);

But heres where I’m assuming core Magento devs got lost in the bowels of the EAV resource model and just left it partially complete.

    protected function _getModifySqlFiles($actionType, $fromVersion, $toVersion, $arrFiles)
    {
        $arrRes = array();
        switch ($actionType) {
            case 'install':
            case 'data-install':
    ...
            case 'rollback':
                break;
            case 'uninstall':
                break;
        }
        return $arrRes;
    }

I’ve not had a chance to really test out the above, but from just my initial investigations of the ORM that is magento and the Autoloading as well as another developer’s input on his findings as well.

Ultimately it would be ideal if we can keep all of our changes at least module wise within a version controlled system. Obviously huge data sets that need to be imported shouldn’t be managed this way but for these small incremental changes I want to push to staging, production test and if it fails pull it back one version and everything is back to normal.

Obviously theres no one ideal solution for deployment with so many clients having different requirements and needs but a general way of doing this would help with code/SQL deployment. It’s kind of ironic that Enterprise has CMS staging, and the ability for modular development of code, but the DB has not gotten as much love.

There is a related question that is noting how currently we are doing it with some specialized scripts “home-brewed” that essentially do:

Doing a MySQLDump or backup, then doing a replace on the BASE_URLs in the SQL file.

Another tool to look at would be arrow Phing.

[tip]If anyone has time to investigate the “rollback” and “uninstall” processes that seem to be implemented and report their findings would be helpful to me as well.[/tip]

More reading:
arrow Best Practicies for Magento deployment.
arrow My original SO Response.