0

I've done a migration from Magento 1.9 to Magento 2.1.5. All product are present in catalogue and subcategories, but some product (not all) are not rendered on the frontend in the page of macrogategories. I've checked from the admin if there are some difference in the congiguration of the products, but all have the same and I can't understand where is the problem.

0

Try to go to Products > Catalog select all and go to Actions > Change Status > Disable and then Enable.

Then add this two files on original modules folder.

app\code\Modules\Catalog\etc\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\Catalog\Model\Indexer\Category\Product\Action\Full" type="Modules\Catalog\Model\Indexer\Category\Product\Action\Full" />
</config>

app\code\Modules\Catalog\Model\Indexer\Category\Product\Action\Full.php

<?php 
namespace Modules\Catalog\Model\Indexer\Category\Product\Action;

/**
 * Class AbstractAction
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/

class Full extends \Magento\Catalog\Model\Indexer\Category\Product\Action\Full {

    public function isRangingNeeded() {
        return false; // It was "True" as default setting.
    }
}

And go to Stores > Configuration > Catalog > Inventory > Stock Options and make Display Out of Stock Products set to Yes.

Then, run this command.

php bin/magento cache:clean
php bin/magento indexer:reindex

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.