1

I've seen a similar thread here but it just doesn't work for me, maybe because of using Magento 2.15 instead of Magento 2.0 which had some major changes.

I'm not able to get Products to show on the Product page, due to "Call to an undefined function toHtml() on null", the getImage function is returning null.

Following this here: Magento 2 - How To Display Cross Sell Products On Product Details Page (PDP)?

Thanks for any help.

  • Did you ever get to the bottom of this? I Have the same issue however unsure how to resolve. – harri Jun 30 '17 at 9:51
0

I've just had this issue also and after a few hours playing have got a solution here: Crosssell Products on Product Page with Magento 2

-1

Paste this code to inside contaner of catalog_product_view.xml

<block class="Magento\Checkout\Block\Cart\Crosssell" name="product.view.crosssell" template="Magento_Catalog::product/list/items.phtml" after="-">
    <arguments>
        <argument name="type" xsi:type="string">crosssell</argument>
    </arguments>
    <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="crosssell.product.view" as="addto">
        <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare" name="crosssell.product.addto.compare.view" as="compare" template="Magento_Catalog::product/list/addto/compare.phtml"/>
    </block>
</block>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.