1

Can anyone have faced the below error while opening the product listing page at the storefront?

After upgrade magento version 2.4.3 to 2.4.5 I am facing.

1 exception(s): Exception #0 (Exception): Notice: Object of class Magento\Framework\Phrase could not be converted to int in /home/public_html/website/vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar/limiter.phtml on line 26

asked Jul 24, 2023 at 20:49

1 Answer 1

0

You have to override vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar/limiter.phtml in your custom theme.

Then create a file inside your theme app/design/frontend/VendorName/ThemeName/Magento_Catalog/templates/product/list/toolbar/limiter.phtml

Add below code to the file

<?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(
 is_numeric($_limit) ? $localeFormatter->formatNumber((int) $_limit) : $_limit
 ) ?>
 </option>
 <?php endforeach; ?>
 </select>
 </div>
 <span class="limiter-text"><?= $block->escapeHtml(__('per page')) ?></span>
</div>
answered Jul 25, 2023 at 5:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.