0m3r
4/24/2014 - 9:11 AM

easycolorswatches + ajaxpro configurable product view

easycolorswatches + ajaxpro configurable product view

//add in EOF
document.observe("AjaxPro:message:show:after", function() {
    if (-1 == AjaxPro.config.get('handles').indexOf('catalog_product_view')) {
        window.eval.defer('initEasyColorSwatch();');
    }
 });
<?php

class TM_AjaxPro_Model_Observer {
/*...*/

/**
TM_AjaxPro_Model_Observer add line after 

//fix configurable trabl (remove from form url bad suffix)
$content = str_replace('?___SID=U', '', $content);
*/

$_block = $layout->getBlock('easycolorswatches')->toHtml();
$content .= $_block;

/*...*/
}
<?xml version="1.0"?>
<layout>
    <!-- ... add EasyColorSwatches.js on catalog_category_view -->
    <catalog_category_view>
        <reference name="before_body_end">
            <block type="easycolorswatches/categoryoption" name="easycolorswatches">
                <action method="setTemplate" ifconfig="easycolorswatches/general/enabled">
                    <template>easycolorswatches/categorycolorswatch.phtml</template>
                </action>
            </block>
        </reference>
        <reference name="head">
            <action method="addItem" ifconfig="easycolorswatches/general/enabled">
                <type>skin_css</type>
                <name>css/easycolorswatches.css</name>
            </action>
             <action method="addItem" ifconfig="easycolorswatches/general/enabled">
                <type>skin_js</type>
                <name>js/EasyColorSwatches.js</name>
            </action>
        </reference>
    </catalog_category_view>
   <!-- ... -->
</layout>