I want to display more than 4 products in the related products block. I've tried some solutions like overriding the core Related.php class and using methods:


Also, changed the $limit variable to 6 in the related.phtml file, but none of these worked.I want to increase the products count here: enter image description here

Any kind of help would be appreciated

  • Please check for number of products assigned as related products. May 11, 2021 at 10:31
  • Could you specify where to check? May 11, 2021 at 10:33
  • Check in the backend for product which you are checking. Catalog -> Product -> Related Products section. May 11, 2021 at 10:34
  • I want to display more than 4 on all products and I can't see anything I can change to increase the count to more than 4 in .phtml nor Related.php May 11, 2021 at 10:35
  • Have you checked in backend? more than 4 products are assigned as related products. May 11, 2021 at 10:44

2 Answers 2


There is no fixed limit on how many related products magento shows on your product page. Depending on the screen width it will allow you no navigate throug them or show them all at once.

Please on your back end go to CATALOG => PRODUCTS. Edit the product you want to add related products to. Scroll down until you find this section "Related Products, Up-Sells, and Cross-Sells ". Expand it and and now you can add as many products as you wich :)

enter image description here


Edit below code

  1. vendor/magento/module-catalog/Block/Product/ProductList/Related.php


protected function _prepareData()
        $product = $this->getProduct();
        /* @var $product \Magento\Catalog\Model\Product */

        $this->_itemCollection = $product->getRelatedProductCollection()->addAttributeToSelect(

        if ($this->moduleManager->isEnabled('Magento_Checkout')) {

        foreach ($this->_itemCollection as $product) {

        return $this;

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.