Archived : Techno Babble

This is the archived version of my b2evolution code blog.
If you require any help regarding b2evolution then
visit it's support forums

You can find my current blogs here
Code : {@link : WafflesOn}
Personal : {@link : InnerVisions}

« Playing with a blogrumPlaying with an RSS reader »

Magento anybody?

Posted on 24th Feb 2008 in : Techno Babble

Add dash of XML....

I've been a smidge quiet lately because we're in the middle of re-skinning an old OS-Commerce store. As always we started by creating a shiny new dev sub-domain for it to live on so we don't break the live site ..... problem number 1, OS-Commerce requires register globals to be enabled before it can run .... wtf? Not a chance that's going to happen on our server, not even a dev site! .... so, joy of joys we now need to find another e-commerce solution as well as skin it!

After wandering around the demo areas for a few other e-commerce solutions and listening to suggestions from other people we eventually ended up picking Magento Commerce ..... cool, decision made, time to go to work.

Did I mention XML yet?

So, I got handed this shiny new software and a picture of the proposed skin with "let me know when you've sorted all the code out" ... and into the deep end I dived ....... I wish like hell I hadn't ... I have NEVER seen so many files required for a skin in all my life!! ..... seriously, I didn't even bother to count them, mainly because I have trouble with 3 digit numbers, but also because I get bored easily .... but, how hard could it be right? ....... wrong! As well as having more files than a blonde can count before either the boredom threshold or upper number cap is hit, they also have this reaaaaaally "flexible" approach to skinning where everything is controlled by XML files, and some other files.

This one controls the catalogue, note, this is just for viewing the catalogue, there's another for customers, and one for checkout .... ohhh and another for sales, and one for searching the catalogue ...... etc

Bash:

<?xml version="1.0"?>
<!−−
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* @category   design_default
* @package    Mage
* @copyright  Copyright (c) 2004-2007 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*/
 
Supported layout update handles (action):
- catalog_product_gallery
- catalog_product_compare_index
 
Supported layout update handles (special):
- default
- catalog_category_default
- catalog_category_layered
- catalog_product_view
 
−−>
<layout version="0.1.0">
 
<!−−
Default layout, loads most of the pages
−−>
 
    <default>
 
        <!−− Mage_Catalog −−>
        <reference name="top.menu">
            <block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
        </reference>
        <reference name="right">
            <block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
                <action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
                <action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (800) DEMO-NUMBER.</alt></action>
                <action method="setLinkUrl"><url>checkout/cart</url></action>
            </block>
        </reference>
        <reference name="right">
            <block type="core/template" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
            <block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"/>
        </reference>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title><prepare>true</prepare></action>
        </reference>
 
    </default>
 
 
<!−−
Category default layout
−−>
 
    <catalog_category_default>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list"></block>
            </block>
        </reference>
    </catalog_category_default>
 
<!−−
Category layered navigation layout
−−>
 
    <catalog_category_layered>
        <reference name="left">
            <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
        </reference>
        <reference name="content">
            <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <block type="catalog/product_list" name="product_list"></block>
            </block>
        </reference>
    </catalog_category_layered>
 
<!−−
Compare products page
−−>
 
    <catalog_product_compare_index>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/one-column.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>scriptaculous/scriptaculous.js</script></action>
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_compare_list" name="catalog.compare.list" template="catalog/product/compare/list.phtml"/>
        </reference>
    </catalog_product_compare_index>
 
    <customer_account_index>
 
        <reference name="right">
            <action method="unsetChild"><name>catalog_compare_sidebar</name></action>
        </reference>
    </customer_account_index>
 
<!−−
Product view
−−>
 
    <catalog_product_view>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
                <block type="catalog/product_view_super_config" name="product.info.config" as="super_config" template="catalog/product/view/super/config.phtml"/>
                <block type="catalog/product_view_super_group" name="product.info.group" as="super_group" template="catalog/product/view/super/group.phtml"/>
                <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml"/>
                <block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />
            </block>
        </reference>
        <reference name="right">
            <block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
        </reference>
 
    </catalog_product_view>
<!−−
Product send to friend
−−>
<catalog_product_send>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="head">
            <action method="addJs"><script>varien/product.js</script></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_send" name="product.send" template="catalog/product/send.phtml">
            </block>
        </reference>
    </catalog_product_send>
 
<!−−
Product additional images gallery popup
−−>
 
    <catalog_product_gallery>
        <!−− Mage_Catalog −−>
        <reference name="root">
            <action method="setTemplate"><template>page/one-column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_gallery" name="catalog_product_gallery" template="catalog/product/gallery.phtml"/>
        </reference>
    </catalog_product_gallery>
 
<!−−
Site Map block
−−>
    <catalog_seo_sitemap_category>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
              <block type="catalog/seo_sitemap_container" name="seo.container" template="catalog/seo/sitemap/container.phtml"/>
        </reference>
    </catalog_seo_sitemap_category>
    <catalog_seo_sitemap_product>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
              <block type="catalog/seo_sitemap_container" name="seo.container" template="catalog/seo/sitemap/container.phtml"/>
        </reference>
    </catalog_seo_sitemap_product>
<!−−
Catalog search terms block
−−>
    <catalog_seo_searchterm_popular>
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="catalog/seo_searchterm" name="seo.searchterm" template="catalog/seo/searchterm.phtml"/>
        </reference>
    </catalog_seo_searchterm_popular>
 
</layout>

++?????++ Out of Cheese Error. Redo From Start.

Ok, I know I'm blonde and it doesn't take a lot to confuse my poor cell, but bloody hell I normally at least have a chance of grasping stuff within a reasonable time frame ........ seven hours later my wall is starting to take on the shape of my forehead but at least I finally managed to move the sidebar from the right side to the left side .... I'm a genius :D :| ....... faaaaaaaaaantastic, now all I need to be able to do is move every component to the location of my choice and code up all the extra modules that we require for the proposed template .... suddenly Everest looks like a small rock.

Several days later and I'm a smidge more au fait, or whatever that flash french saying is for "got slightly to grips with", with their templating system, and I've managed to satisfy myself that I can at least achieve our requirements within my lifetime, and I've begun making all the changes that we need.

How to prune a skin

It didn't take me long to get bored with all the files and folders required for a bloody skin, so instead of altering their files I decided to make a single folder for all my changed files to live in. Compared to their god knows how many, I'm currently floating around the half-dozen mark, mind you, there's a long way to go yet but I should hopefully keep the total to way less than half of theirs, and the framework of the skin is finally coming together ..... which will cheer Dexter up, as he's raring to go with the new shop as soon as possible ;)

Did I mention I think the skinning system is over complicated? Seriously over complicated. I really hope that the developers of the software do a 100% rethink about their skinning system. Not only is it FAR to complicated for the average joe to contemplate playing with, it *appears* to put a fair load on a server whilst it decodes all the files, there's several posts on their forums about it, I can't really tell as I'm playing with very little test data, but that'll change soon as we start adding more products for a dry run.

Would *I* recommend Magento?

Despite all of the above I actually would, as long as you don't have a huge store and either have a masochistic outlook on life or you have enough money to pay somebody to skin it for you. The main things that impressed me about the software was that the default template has an XHTML Strict doc type and the admin area was better than all the others that I'd seen by a long way. Remeber that it's still in beta though, and not really recommended for a live site ;)

Note : If you're even remotely considering asking us to do a Magento skin for you then our prices start at £2,000 .... or £20 a file, whichever is greater :|

¥

26 comments

Comment by Gary { @link http://garysblog.co.uk } on 28/02/08
Blondes have all the fun huh ;)

Gz
Comment by Gary { @link http://garysblog.co.uk } on 29/02/08
BTW my Internet connection has died, any ideas ?

Gz ;)
Comment by ¥åßßå on 29/02/08
Try sending an email to your ISP asking them to look into it for you :roll:

¥
Comment by Gary { @link http://garysblog.co.uk } on 29/02/08
LOL, I did, they passed me on to your Dad and then he advised me to call you, just don't have a spare 7 hours though :)

Have a good weekend Paul,

Gz ;)
Comment by Gary { @link http://garysblog.co.uk } on 29/02/08
Here's one for you !
If a person suffered from amnesia and then was cured, would they remember that they forgot?

:lalala:
Gz
Comment by ¥åßßå on 29/02/08
Dunno, but I bet they'd wonder what the doctors bill was for :roll:

¥
Comment by ¥åßßå on 29/02/08
If that wasn't so real it'd be funny :|

¥
Comment by Gary { @link http://garysblog.co.uk } on 01/03/08
Lol :D

Gz
Comment by wily { @link http://unre.st/ } on 10/03/08
I was completely stumped with Magento for a day. (And I've commercially coded PHP/X{ML,HTML}/MySQL web applications)

Load in the sample data and it makes a lot more sense! Also, the sample data creates a proper hierarchy of categories, so menus et al start working. :D
Comment by Lurker on 19/03/08
OFF TOPIC
Yipeee, I got broadband back (8mb)and I am pleased with it up to now. Downloaded a 50mb file in about 40-50 seconds :) Even better, I am in my front room on my lappy wireless, it was a sinch to set-up.

How cool :)

Gz
Comment by FurQ on 02/05/08
I'm using Magento 1.0 now, or trying to .. :(

My advice don't, the templating is terrible - and I've been a PHP/web developer for 10 years and a software engineer for 20.

The templating, or the the laughable CMS side is beyond a joke - as I say I'm a developer and I find it a nightmare - how are non techies supposed to cusomise the themes!?

Stay away from Magento unless you've got months to spare (never) or are just creating a clone of their shop (never).

It's well structured code-wise, professionally designed, and they miss with something as simple as templating and cusomising - how dumb is that. If I'd done I'd fire me, fortunately I'm the boss of me so I can - I'm beginning to hate Magento and I was overjoyed to start with..

Stupid stupid stupid!!!!! waaah!
Comment by ¥åßßå on 03/05/08
I've got the pleasure of upgrading the shop to 1.0, now that it's been released, with a tad of luck I won't have to redo all the template stuff that I've done already.

They definitely lost the plot when they coded the skinning system, think a few to many hallucinogenics were used during the development stage :roll: It's a shame really because the rest of the product is pretty nice.

Good luck with your skin ;)

¥
Comment by Lurker on 30/07/08
I'm not blonde but I did the seven hour thing too. Now I'm now downloading free skins to see if I can customize them any better. Sheesh what a pain in the patoot! But a way better interface than Zen or osCommerce. Does anyone else have a better PHP cart of choice??

but check these sleek Mag skins out...

http://www.magthemes.com/free-themes/

*edit*
You can add proper links to my comments huh?;) ... made yours a real one
Comment by ¥åßßå on 30/07/08
I feel your pain ;)

The backend looks pretty cool, and has shedloads of settings ... but it's slow as hell .... and I'm *really* not into the javascript reliance .... but I still think it's a great cart

¥
Comment by Lurker on 27/08/08
:>:roll::oops::oops::oops::oops::oops::|:|:-/

CSS:

[/codeblock][codeblock lang="php" line="1"]

XML:

[/codeblock][codeblock lang="" line="1"]
Comment by ¥åßßå on 27/08/08
I guess my comment toolbar works ... thanks for the confirmation :|

¥
Comment by Lurker on 28/08/08
Can I just add that I too am skinning Magento. >:XX nightmare.

Unfortunately, the features and backend admin flexibility make up for the skin. Unfortunately, the people using the admin backend will never know how many times I wanted to quit working as a developer during the skinning process.
Comment by ¥åßßå on 29/08/08
I feel your pain .... daily ;)

¥
Comment by Richard { @link http://www.peacockcarter.co.uk } on 03/09/08
Thanks for the confidence build up, I'm about to start looking at skinning Magento! :P
Comment by ¥åßßå on 04/09/08
It's not so bad once you get your head into it ..... it's just a ballache getting your head into it ;)

¥
Comment by Lurker on 15/11/08
I would **love** to see some YouTube examples of how a real designer skins magento. I've watched the videos from the core team and I got the impression that they have spent way too long developing in j2ee. no reason to use 30 xml files to add 1 picture to a column. Drupal, on the hand, while complicated, does a lot for you. Magento theming doesn't do anything for you. It's a very manual and annoying process. I've been working on a skin with only minor changes for weeks and... I've changed the header and a column picture. wow. There is a reason that only 4 developers in the world have contributed to magento. The core developers need to spend a month learning about how drupal builds communitity if they ever hope to acheive that level of implementation.
Comment by ¥åßßå on 17/11/08
Don't get me started on the number of bloody xml files !

¥
Comment by datashock on 05/05/09
Hi. Just to say :oops:

For all new theme designers.... First put all products, configure attributes, do all you can in Admin, by the way read all the instructions for Magento and Admin.... and then .... maybe try to open some XML.


I did all that, but, from the other side :oops::oops::oops::oops:
Comment by Lurker on 07/05/09
I am a blonde and a girl, I created customer notes thing, that in each order customer can submit comments to the owner, they can talk back and force, so customer comments and admin order comments are merge together to be like conversation...I did not create modules, block as magento suppose to have, just edited some files,created form, retrieve comments from my tables and merge them with core order notes..
Here is my blonde question, if I will upgrade, will my changes and tables go away?
Comment by ¥åßßå on 07/05/09
No idea, but sounds like a cool hack, so worth re-implementing huh? ;)

I'd backup files/db before you tried ;)

¥
Comment by Lurker on 28/08/09
"no reason to use 30 xml files to add 1 picture to a column" lol I feel the pain, i'm in the middle of learning magento and need to create some themes for our companies branding, did i mention XML 88| reminds me off joomla nightmare just trying to get a basic template to work, keep up the good work
Page archived : 11th Nov 2009
 

X