Home » Magento, Magento 226 February 2016

Magento 2: Get Related, UpSell & CrossSell Products

This article shows how we can get related product, upsell product and crosssell products in Magento 2.

Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Framework\Registry class in the constructor of my module’s block class.

app/code/Chapagain/HelloWorld/Block/HelloWorld.php

Printing related, upsell & crosssell product in template (.phtml) file

Using Object Manager

For more, see:

MAGENTO_ROOT/vendor/magento/module-catalog/Model/Product.php

Hope this helps. Thanks.

Magento 2

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Parag

    if (!empty($crossSellProduct)) {

    this should be

    if (!empty($crossSellProducts)) {

  • Corrected. Thanks.