npo*_*art 6 html php magento magento-1.7
在默认布局中,选项和add-to-cart-button被调用
<?php echo $this->getChildChildHtml('container1', '', true, true) ?>
Run Code Online (Sandbox Code Playgroud)
我想从添加到购物车和数量字段中拆分可配置选项,以在布局中的不同位置显示它们.任何想法或准备使用变通方法?
虽然您的最终解决方案将取决于这些块需要在布局中移动/插入的位置,但您绝对可以将 \xe2\x80\x9cAdd to Cart\xe2\x80\x9dproduct.info.options.wrapper.bottom从可配置选项中分离出来product.info.container1,或者product.info.container2像这样:
<catalog_product_view>\n <reference name="product.info.container1">\n <action method="unsetChild"><name>product.info.options.wrapper.bottom</name></action>\n </reference>\n <reference name="product.info.container2">\n <action method="unsetChild"><name>product.info.options.wrapper.bottom</name></action>\n </reference>\n</catalog_product_view>\nRun Code Online (Sandbox Code Playgroud)\n\n单独显示 \xe2\x80\x9cAdd to Cart\xe2\x80\x9d 按钮的最简单方法是注释掉catalog/product/view.phtml允许product.info.addtocart显示块的条件,无论产品是否有选项:
<?php if (!$this->hasOptions()): // Remove this condition ?>\n <div class="add-to-box">\n <?php if($_product->isSaleable()): ?>\n <?php echo $this->getChildHtml(\'addtocart\') ?>\n\n ...\n\n <?php endif; ?>\n </div>\n\n ...\n\n<?php endif; ?>\nRun Code Online (Sandbox Code Playgroud)\n\n希望这可以帮助您理解这些块的结构。可能有帮助的其他资源:
\n\n\n| 归档时间: |
|
| 查看次数: |
5671 次 |
| 最近记录: |