When i am adding upsell product it is showing more then 4 on product page. But when i am assigning more then 4 product to cross-sell it's only showing 4 product on cart page.

I want to show more then 4 product in cross-sell.

2 Answers 2


You need to override Magento/Checkout/Block/Cart/Crosssell.php file.

Create Vendor/MyModule/etc/frontend/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Cart\Crosssell" type="Vendor\MyModule\Block\Checkout\Block\Cart\Crosssell" />

Create Vendor/MyModule/Block/Checkout/Block/Cart/Crosssell.php

namespace Vendor\MyModule\Block\Checkout\Block\Cart;

use Magento\CatalogInventory\Helper\Stock as StockHelper;

class Crosssell extends \Magento\Checkout\Block\Cart\Crosssell
    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Catalog\Model\Product\Visibility $productVisibility,
        \Magento\Catalog\Model\Product\LinkFactory $productLinkFactory,
        \Magento\Quote\Model\Quote\Item\RelatedProducts $itemRelationsList,
        StockHelper $stockHelper,
        array $data = []
    ) {

        $this->_maxItemCount = 8; //put ur limit here
  • Let me try your solutions and check. Commented Jan 6, 2020 at 9:42

You can also use the layout if you don't want to create a plugin.

Create the file app/design/frontend/Vendor/default/Magento_Catalog/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="product.info.upsell">
            <action method="setItemLimit">
                <argument name="type" xsi:type="string">upsell</argument>
                <argument name="limit" xsi:type="string">5</argument> //Set Limit As Per Your Requirement

  • wouldn't this be for upsell, and not crosssell?
    – omerts
    Commented Aug 4, 2021 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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