Wednesday, August 27, 2014

Ultimate module creator

On August 27th 2014 I released the version of the Ultimate module creator.
You can get from github or from magento connect
You can see here the release notes for the new version.
You can also checkout the documentation.

Monday, April 14, 2014

Ultimate module creator 1.9.0

I'm getting close to releasing a new version of the Ultimate Module Creator.
Version 1.9.0 will be released soon and it has a lot of new features and bug fixes.
It is based on the previous version (1.6.3) but it is not backwards compatible. So I suggest that instead of trying an upgrade remove the previous version and install this new one.

The new version is available on github and Magento Connect starting with April 25th 2014.

The 1.6 version will still be available on github but there will be no support for it.

Here are some key features from the new version. For a full list of release notes see this.

  • Features
    • Support for EAV entities.
    • Module Admin menu can be placed anywhere in the menu tree.
    • The frontend route of the module can be set manually on creation instead of using the module name.
    • Allow users to comment on the generated entities.
    • Link entities in a many to many relation with the catalog categories.
    • Additional attribute types (dropdown, multiselects)
    • Ability to add many to many relations between tree entities
    • Displaying flat entities by store is optional now.
  • Improvements
    • Pimped up the admin UI of the module creator
    • Faster admin UI. No more ajax calls to add a new attribute or a new entity.
    • Made the HELP section include more valuable data.
    • The aliases for models/blocks/helpers include the module namespace to avoid conflicts
    • Generate an uninstall file to make it easier to remove installed modules.
  • Bug Fixes
    • Most important: Module names can include uppercase letters. Until now using 'ModuleName' for the name of the module would make that module unusable on UX servers. Now it works.
    • Entities were not displaying in product page unless they had a separate view page.
    • Replaced 'addFilter' that had no effect with 'addFieldToFilter'
If you try it out and find any issues or have new ideas please post them on github.

Monday, November 11, 2013

Product relations importer

Check out the product relations import tool for Magento. This extension allows you to quickly update/replace related products, upsells and crossells for your catalog products. You can do that by manual input or file upload.

Thursday, October 31, 2013

Easylife Switcher extension

I've just released a new Magento extension called 'Easylife_Switcher'.
This is what it does:
  • Frontend:
    • it can change the configurable products dropdowns to text or image labels
    • it allows you do display the out od stock combinations of configurable products with a "not available" overlay (see image above - medium size). The out of stock products may be selectable or not. Your choice.
    • it can change the main image in the product page when a combination is selected, if an image is available for the simple product. You can set the attributes that change the image.
    • it can change the full media block in the product page when a combination is selected, if at least the main image is available for the simple product. You can set the attributes that change the media section.
  • Backend:
    • it allows you to set a default configuration to be selected while accessing the configurable product page.
Code and more details on how to use can be found here:

Friday, April 19, 2013

Monday, April 8, 2013

Thursday, March 28, 2013

Get class rewrites

Here is a small script that lists all rewrites for models, blocks and helpers in Magento.
It also takes into account the disabled extensions but this should't be a big issue.
Create a new file on the root of your magento instance. Let's call it rewrites.php with this content.
$folders = array('app/code/local/', 'app/code/community');//folders to parse
$configFiles = array();
foreach ($folders as $folder){
    $files = glob($folder.'*/*/etc/config.xml');//get all config.xml files in the specified folder
    if (is_array($files)){
        $configFiles = array_merge($configFiles, $files);//merge with the rest of the config files
$rewrites = array();//list of all rewrites

foreach ($configFiles as $file){
    $dom = new DOMDocument;
    $xpath = new DOMXPath($dom);
        $path = '//rewrite/*';//search for tags named 'rewrite'
        $text = $xpath->query($path);
        foreach ($text as $rewriteElement){
            $type = $rewriteElement->parentNode->parentNode->parentNode->tagName;//what is overwritten (model, block, helper)
            $parent = $rewriteElement->parentNode->parentNode->tagName;//module identifier that is being rewritten (core, catalog, sales, ...)
            $name = $rewriteElement->tagName;//element that is rewritten (layout, product, category, order)
            foreach ($rewriteElement->childNodes as $element){
                $rewrites[$type][$parent.'/'.$name][] = $element->textContent;//class that rewrites it
echo "<pre>";print_r($rewrites);
When accessing you should be able to see all the model, block and helper rewrites. If there is one object rewritten by 2 or more classes it means you have an extension conflict.

Monday, March 25, 2013

Add custom page layout

Here is now you can add a custom page layout (similar to 1column, 2columns,....) without editing the core files.
Create a new module. Let's call it Easylife_Layout.
For this you need the following files:
app/etc/modules/Easylife_Layout.xml - the declaration file
<?xml version="1.0"?>
                <Mage_Page />
app/code/local/Easylife/Layout/etc/config.xml - the configuration file
<?xml version="1.0"?> 
                <custom_layout module="page" translate="label">
                    <label>Custom layout</label>
app/design/frontend/{interface}/{theme}/layout/easylife_layout.xml - the layout file (I recommend creating it inside the base/default theme so it will be available for all the custom themes)
<?xml version="1.0"?> 
    <custom_layout translate="label">
        <label>Custom layout</label>
        <reference name="root">
            <action method="setTemplate"><template>page/custom_layout.phtml</template></action>
            <action method="setIsHandle"><applied>1</applied></action>
app/design/frontend/{interface}/{theme}/template/page/custom_layout.phtml - the page html - feel free to customize it as you want. this is just a copy of 1column.phtml with some new added classes (I recommend creating it inside the base/default theme so it will be available for all the custom themes)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<?php echo $this->getChildHtml('head') ?>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper custom-layout">
    <?php echo $this->getChildHtml('global_notices') ?>
    <div class="page">
        <?php echo $this->getChildHtml('header') ?>
        <div class="main-container custom-layout-container">
            <div class="main">
                <?php echo $this->getChildHtml('breadcrumbs') ?>
                <div class="col-main">
                    <?php echo $this->getChildHtml('global_messages') ?>
                    <?php echo $this->getChildHtml('content') ?>
        <?php echo $this->getChildHtml('footer') ?>
        <?php echo $this->getChildHtml('before_body_end') ?>
<?php echo $this->getAbsoluteFooter() ?>
That's it. If you want to load your layout in a custom layout xml file (let's say for your custom entities display) just add this inside the page handle
<update hande="custom_layout" />
The new layout should be available for all the CMS pages and category/product display settings.

Saturday, March 16, 2013

Monday, March 4, 2013