如何在 Magento 2 中将交叉销售产品显示为 product.info.details
How to show cross sell products into product.info.details in Magento 2
我正在尝试在 product.info.details 选项卡中显示交叉销售产品
这是我在 catalog_product_view.xml 中感兴趣的代码部分:
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\ProductList\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>
</referenceBlock>
但它没有显示任何内容。
已解决
使用此代码解决:
<block class="Magento\Checkout\Block\Cart\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>
使用此代码解决:
<block class="Magento\Checkout\Block\Cart\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>
我正在尝试在 product.info.details 选项卡中显示交叉销售产品
这是我在 catalog_product_view.xml 中感兴趣的代码部分:
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\ProductList\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>
</referenceBlock>
但它没有显示任何内容。
已解决
使用此代码解决:
<block class="Magento\Checkout\Block\Cart\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>
使用此代码解决:
<block class="Magento\Checkout\Block\Cart\Crosssell" template="Magento_Catalog::product/list/items.phtml" name="crosssell.tab" as="crossselltab" group="detailed_info" >
<arguments>
<argument translate="true" name="title" xsi:type="string">Cross sell</argument>
<argument name="type" xsi:type="string">crosssell</argument>
</arguments>
</block>