skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    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 MagentoCatalogBlockProductProductListToolbar $block
     * @var MagentoFrameworkLocaleLocaleFormatter $localeFormatter
     */
    ?>
    <div class="field limiter">
        <label class="label" for="limiter">
            <span><?= $block->escapeHtml(__('Show')) ?></span>
        </label>
        <div class="control">
            <select id="limiter" data-role="limiter" class="limiter-options">
                <?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 class="limiter-text"><?= $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


  2. This should fix the issue: https://github.com/magento/magento2/commit/bb55549cd3016987663272e7ffe3f452c8d6e40d

    You can create a patch for it.

    vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar/limiter.phtml

                <?php if ($block->isLimitCurrent($_key)):?>
                    selected="selected"
                <?php endif ?>>
    -           <?= $block->escapeHtml($localeFormatter->formatNumber((int) $_limit)) ?>
    +           <?= $block->escapeHtml(
    +               is_numeric($_limit) ? $localeFormatter->formatNumber((int) $_limit) : $_limit
    +           ) ?>
            </option>
        <?php endforeach; ?>
    </select>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search