2016-08-02 10 views

答えて

1

: - catalog_product_compare_index.xmlとして名前のレイアウトファイルを作成し、コードの下に追加作成されたファイルに保存されます。

<?xml version="1.0"?> 
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> 
    <head> 
     <css src="Magento_Swatches::css/swatches.css"/> 
    </head> 
    <body> 
     <referenceContainer name="content"> 
      <referenceBlock name="catalog.compare.list"> 
       <action method="setTemplate"> 
        <argument name="template" xsi:type="string">W3solver_Compareswatch::product/compare/list.phtml</argument> 
       </action> 
       <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers"> 
        <block class="Magento\Swatches\Block\Product\Renderer\Listing\Configurable" as="configurable" template="Magento_Swatches::product/listing/renderer.phtml" /> 
       </block> 
      </referenceBlock> 
     </referenceContainer> 

    </body> 
</page> 

あなたは、これは比較ページ上のカラーパッチを表示します63

<?php 
    if($_item->getTypeId() == "configurable"): 
     echo $block->getProductDetailsHtml($_item); 
    endif; 
?> 

行にオーバーライドlist.phtmlで一つの機能を追加する必要があります。

関連する問題