加载“;Compare Products”;在同一个窗口Magento


Load "Compare Products" in same window Magento

我有一个Magento网站,我禁用了比较文件上的弹出窗口,所以现在它加载在一个空白页面中。我需要的是让"比较产品"加载在同一个页面上,但仍然保持一切原样(设计、菜单等)。

感谢

转到您的自定义主题文件夹

打开这个文件

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

更换为此按钮

<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>

从这个按钮

<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>

找到这个并更新您的catalog.xml(找到这个catalog_product_compare_index并更改模板名称)布局文件

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

也许它会对您有所帮助(注意:不要更改默认主题)

从以下位置复制sidebar.html

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

把它放在你新创建的主题中(主题名称根据你的选择),你现有的主题在同一个方向

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

按我上次回答的方式更改按钮

然后去你的管理员

系统-->设计-->添加设计更改-->自定义设计-->从下拉菜单中选择您的_theme_name保存

从your_theme_name 的catlog.xml文件中查找catalog_product_compare_index

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

并更改波纹管线路代码

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

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

全部完成

你的答案很好,但你在最后一步犯了一个小错误。您说要在以下位置从catalog.xml中查找catalog_product_compare_index:

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

正确的位置是:

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

如果一个初学者读到这篇文章,他不会理解其中的区别,也找不到文件。我是个初学者,有一段时间我被困在这里了。