更新到Magento 2.4.5后,产品分类页面不再显示产品。但是,页面左侧的过滤器会指示产品应该可见,例如:
我尝试了以下方法来解决此问题,但没有效果:
9q78igpj1#
经过长时间的搜索,我找到了这个问题,并解决了这个问题。这似乎是一个围绕目录选项显示所有产品的问题。解决方法选项1:覆盖主题中的limiter.phtml:app/design/frontend/Your/Theme/Magento_Catalog/templates/product/list/toolbar/limiter.phtml个
limiter.phtml
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 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>
执行此操作后,请确保运行:php bin/magento setup:di:compile解决方法选项2:转到Stores > Settings > Configuration > Catalog > Catalog关闭Allow All Products per Page将Allow All Products per Page设置为否
php bin/magento setup:di:compile
Stores > Settings > Configuration > Catalog > Catalog
Allow All Products per Page
执行此操作后,请确保运行:
php bin/magento setup:di:compile php bin/magento cache:flush
https://github.com/magento/magento2/issues/35900#issuecomment-1210181110
1条答案
按热度按时间9q78igpj1#
经过长时间的搜索,我找到了这个问题,并解决了这个问题。这似乎是一个围绕目录选项显示所有产品的问题。
解决方法选项1:
覆盖主题中的
limiter.phtml
:app/design/frontend/Your/Theme/Magento_Catalog/templates/product/list/toolbar/limiter.phtml
个执行此操作后,请确保运行:
php bin/magento setup:di:compile
解决方法选项2:
转到
Stores > Settings > Configuration > Catalog > Catalog
关闭Allow All Products per Page
将
Allow All Products per Page
设置为否执行此操作后,请确保运行:
https://github.com/magento/magento2/issues/35900#issuecomment-1210181110