在同一窗口Magento中加载“比较产品”

I have a Magento site and I disabled the pop up on the compare file so now it loads in a blank page. What I need is to make the "Compare Products" load in the same page but still keep everything as is (design, menus etc).

Thank you

Go to the your custom theme folder

open this file

your_custom_theme\template\catalog/product/compare/sidebar.phtml

Replace with this button

<button type="button" title="<?php echo $this->__('Compare') ?>" class="button" onclick="setLocation('<?php echo $this->htmlEscape($_helper->getListUrl()) ?>')"><span><span><?php echo $this->__('Compare') ?></span></span></button>

From this button

<button type="button" title="<?php echo $this->__('Compare') ?>" class="button" onclick="popWin('<?php echo $_helper->getListUrl() ?>','compare','top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes')"><span><span><?php echo $this->__('Compare') ?></span></span></button>

Find this and update on your catalog.xml( find this catalog_product_compare_index and change the template name) layout file

<catalog_product_compare_index>

    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference></catalog_product_compare_index>

May be it will help you (Note: Don't make changes on the default theme )

Copy the sidebar.phtml from the bellow location

'app\design\frontend\base\default\template\catalog\product\compare'

Put it in your new created theme ( theme name according your choice ) ya existing theme in same directroy strature

'app\design\frontend\default\your_theme_name\template\catalog\product\compare'

change the button as i said my previous answer

Than go to your admin

system --> design --> Add design change --> Custom Design --> select your_theme_name (from the dropdown) save

Find catalog_product_compare_index from catlog.xml file from your your_theme_name

'app\design\frontend\default\your_theme_name\layout\'

and change the bellow line code

<reference name="root">
        <action method="setTemplate"><template>page/popup.phtml</template></action>
    </reference>

to

 <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>

All Done

Your answer is good but you made a little mistake in the last step. You said to find catalog_product_compare_index from catalog.xml in the following location:

'app\design\frontend\default\your_theme_name\layout\'

The correct location is:

'app\design\frontend\your_theme_name\default\layout\'

If a beginner reads this he wouldn't understand the difference and wouldn't find the file. I'm a beginner and I was stuck here for a moment.