Configurable product modification in Magento

Featured Image

In this article, I’ll give you extension that will change drop down selection (select field) to radio buttons on configurable products in Magento Community edition.

Well, what I had to do is rewrite Mage_Catalog_Block_Product_View_Type_Configurable block, and create a custom phtml file (configurable.phtml) with some custom validation on it.

Everything I just told you equals to this config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Inchoo_Configurable>
            <version>0.1.1</version>
        </Inchoo_Configurable>
    </modules>
    <global>
        <models>
            <configurable>
                <class>Inchoo_Configurable_Model</class>
            </configurable>
        </models>
        <blocks>
            <configurable>
                <class>Inchoo_Configurable_Block</class>
            </configurable>
            <catalog>
                <rewrite>
                    <product_view_type_configurable>Inchoo_Configurable_Block_Frontend_Configurable</product_view_type_configurable>
                </rewrite>
            </catalog>
        </blocks>
    </global>
    <frontend>
        <layout>
            <updates>
                <configurable module="Inchoo_Configurable">
                    <file>configurable.xml</file>
                </configurable>
            </updates>
        </layout>
    </frontend>
</config>

And block rewrite consisted of addition of new method “getRegularConfig” that corresponds to “getJsonConfig”, except it doesn’t return Json encoded data.

And custom template packed in attached zip file is located under “test” theme folder. For installation you need to extract both layout (configurable.xml) and phtml (configurable.phtml) files.
Notice: keep folder structure for phtml file in your theme

And finally, on modern theme it changes configurable product view from this:

To this:

And finally, you can download it here.

Cheers!

103
Top

Enjoyed this post?

Subscribe to our RSS Feed, Follow us on Twitter and spread it to your friends!

Author

Mladen Lotar

Ex. Inchooer

Mladen worked at Inchoo from 2010 to 2011 in the role of Magento/Zend developer

Other posts from this author

Discussion 103 Comments

1 2 3
Add Comment
  1. Fe

    Unfortunately it does not work with special prices. I saw in configurable.php that it gets the special price by ->getFinalPrice but on the frontend it always displays the regular price.

  2. Mayur Ghediya

    Thanks for nice extension .it’s working fine for me

    can u help me .
    i would like to set attribute option like “amazon” button
    so is there any type of plugin available?

  3. krit

    image configuration product error? http://i1195.photobucket.com/albums/aa396/krites007/1a.gif How to edit it? Please teach me. please.

1 2 3

Add Your Comment

Please wrap all source codes with [code][/code] tags.
Top