0

When i change the limit value, i really want to send the same value to all pages

enter image description here

vendor/magento/module-catalog/Block/Product/ProductList/Toolbar.php

public function getLimit()
    {

        $limit = $this->_getData('_current_limit');
        if ($limit) {
            return $limit;
        }

        $limits = $this->getAvailableLimit();
        $defaultLimit = $this->getDefaultPerPageValue();
        if (!$defaultLimit || !isset($limits[$defaultLimit])) {
            $keys = array_keys($limits);
            $defaultLimit = $keys[0];
        }

        $limit = $this->_toolbarModel->getLimit();
        if (!$limit || !isset($limits[$limit])) {
            $limit = $defaultLimit;
        }

        if ($limit != $defaultLimit) {
            $this->_memorizeParam('limit_page', $limit);
        }

        $this->setData('_current_limit', $limit);
        return $limit;
    }

1 Answer 1

0

It can be change by replacing the following code in Magento_Catalog/templates/product/list/toolbar/limiter.phtml

<select id="limiter" data-role="limiter" class="limiter-options">
            <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
                <option value="<?php /* @escapeNotVerified */ echo $_key ?>"<?php if ($block->isLimitCurrent($_key)): ?>
                    selected="selected"<?php endif ?>>
                    <?php /* @escapeNotVerified */ echo $_limit ?>
                </option>
            <?php endforeach; ?>
 </select>

with

<?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
        <a data-role="limiter" href="#" data-value="<?php /* @escapeNotVerified */ echo $_key ?>"<?php if ($block->isLimitCurrent($_key)): ?>
            class="selected"<?php endif ?>>
            <?php /* @escapeNotVerified */ echo $_limit ?>
        </a>
<?php endforeach; ?>
1
  • dose not work and i don't want this
    – DK Thakur
    Jan 14, 2020 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.