2016-11-10 65 views
0

我試圖沒有成功下面使用的代碼:unsetChild方法沒有在Magento工作1佈局

<reference name="right"> 
    <action method="unsetChild"> 
     <name>product.info.sharing</name> 
    </action> 
</reference> 

圖1:爲兒童塊 Image 1 : for child block

圖片2:父塊 Image 2 :for Parent block

+0

這是我的代碼: <引用名= 「右」> product.info.sharing 但沒有奏效... –

+1

你能告訴你什麼正試圖實現? – damienc

+0

移除magento產品頁面中的社交共享按鈕1 –

回答

0

「product.info.options.wrapper.bottom」 - 它是「product.info」的子塊&「product.info.sharing」意思是sharing.phtml文件附加在「product.info.options.wrapper .bottom「這樣..我已經把這個名字引用,我的解決方案...謝謝。

0

打開模板路徑提示並查看它來自哪個模板文件。

然後您可以在主題的catalog.xml中搜索並查看as中使用的名稱。檢查父塊,在參考標記中使用他的名稱,在標記中使用原始塊的標記as中的值。

在佈局文件夾添加local.xml,試試這個與你的價值觀

<catalog_product_view> 
    <reference name="product.info"> 
      <action method="unsetChild"><name>sharing</name></action> 
    </reference> 
</catalog_product_view> 

清除緩存。

+0

不適合我... !! –

+0

您可以共用路徑那個local.xml和代碼 – Shrikant

+0

<?XML版本= 「1.0」 編碼= 「UTF-8」?> <佈局版本= 「0.1.0」> \t \t <參考名稱= 「product.info」> \t \t <操作方法= 「unsetChild」>共享 \t \t \t \t