Magento将产品信息添加到“更多信息"选项卡 [英] Magento add product info to More Info tab

查看:46
本文介绍了Magento将产品信息添加到“更多信息"选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在说明标签中显示Magento产品的库存信息和Magento产品的价格信息.

I am trying to show Magento product stock information and Magento product price information in the tab Description.

我复制了以下代码: app/design/frontend/default/theme/template/catalog/product/view.phtml

<?php echo $this->getChildHtml('product_type_data') ?>

进入: app/design/frontend/default/theme/template/catalog/product/view/description.phtml

这会在view.phtml上显示股票和价格信息,但在 description.phtml 中什么也不会显示.

This displays the stock and price information on view.phtml, but nothing is shown in description.phtml.

有什么建议吗?

推荐答案

问题是 product_type_data 块是 product.info 的子代(您实际复制的位置)它),而不是 description 块.

The problem is that product_type_data block is a child of product.info (from where you actually copied it) and not description block.

因此,您要做的是将以下代码添加到主题的 local.xml 文件中:

So what do you have to do is to add the following code to local.xml file of your theme:

<PRODUCT_TYPE_simple>
    <reference name="product.description">
        <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                <label>Product Extra Info</label>
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_simple>
<PRODUCT_TYPE_configurable>
    <reference name="product.description">
        <block type="catalog/product_view_type_configurable" name="product.info.configurable" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.configurable.extra" as="product_type_data_extra" translate="label">
                <label>Product Extra Info</label>
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_configurable>
<PRODUCT_TYPE_grouped>
    <reference name="product.description">
        <block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
            <block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra" translate="label">
                <label>Product Extra Info</label>
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_grouped>
<PRODUCT_TYPE_virtual>
    <reference name="product.description">
        <block type="catalog/product_view_type_virtual" name="product.info.virtual" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.virtual.extra" as="product_type_data_extra" translate="label">
                <label>Product Extra Info</label>
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_virtual>

这篇关于Magento将产品信息添加到“更多信息"选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆