Home > Net >  Magento 2 Products Missing from Category Pages after Magento 2.4.5 Update
Magento 2 Products Missing from Category Pages after Magento 2.4.5 Update

Time:10-13

After updating to Magento 2.4.5 product category pages no longer show products. However, the filters on the left side of the page indicate that products should be visible for instance:

Magento 2 products missing

I've tried the following to fix the issue to no avail:

  • Disabled all custom plugins
  • Reverted to the default Luna theme
  • Reindex
  • Clear cache
  • Restarted Elasticsearch

CodePudding user response:

After a long search I was able to find this issue and work-around for this problem. It seems to be an issue around the catalog option to display all products.

Workaround option #1:

Override limiter.phtml in your theme:

app/design/frontend/Your/Theme/Magento_Catalog/templates/product/list/toolbar/limiter.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php
/**
 * Product list toolbar
 *
 * @var \Magento\Catalog\Block\Product\ProductList\Toolbar $block
 * @var \Magento\Framework\Locale\LocaleFormatter $localeFormatter
 */
?>
<div >
    <label  for="limiter">
        <span><?= $block->escapeHtml(__('Show')) ?></span>
    </label>
    <div >
        <select id="limiter" data-role="limiter" >
            <?php foreach ($block->getAvailableLimit() as $_key => $_limit):?>
                <option value="<?= $block->escapeHtmlAttr($_key) ?>"
                    <?php if ($block->isLimitCurrent($_key)):?>
                        selected="selected"
                    <?php endif ?>>
                    <?= $block->escapeHtml($_limit) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <span ><?= $block->escapeHtml(__('per page')) ?></span>
</div>

After doing so be sure to run: php bin/magento setup:di:compile

Workaround option #2:

Turn off Allow All Products per Page by going to Stores > Settings > Configuration > Catalog > Catalog

Set Allow All Products per Page to No

enter image description here

After doing so be sure to run:

php bin/magento setup:di:compile
php bin/magento cache:flush

https://github.com/magento/magento2/issues/35900#issuecomment-1210181110

  • Related