2013-01-06 148 views
1

我試圖在選項卡Description中顯示Magento產品庫存信息和Magento產品價格信息。Magento添加產品信息到更多信息選項卡

我從複製下面的代碼: 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所示。

有什麼建議嗎?

回答

1

問題是,product_type_data塊是product.info(從您實際上覆制它的地方)而不是description塊的孩子。

那麼你所要做的就是下面的代碼添加到local.xml文件的主題:

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

謝謝@tim。我已將您的代碼添加到local.xml,但沒有成功。 – fosterTerence

+0

我非常抱歉。參考塊的正確名稱是'product.description'。我在我的答案中更新了代碼。請嘗試。 –

相關問題