Skip to content

Commit

Permalink
impr
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Charlie committed May 29, 2020
1 parent 6548d3c commit 96e2cc0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/code/Magento/Theme/Block/Html/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,12 +481,8 @@ private function getPageLimitParams(int $limit): array
$data = [$this->getLimitVarName() => $limit];

$currentPage = $this->getCurrentPage();
if ($currentPage === 1) {
return $data;
}

$availableCount = (int) ceil($this->getTotalNum() / $limit);
if ($availableCount < $currentPage) {
if ($currentPage !== 1 && $availableCount < $currentPage) {
$data = array_merge($data, [$this->getPageVarName() => $availableCount === 1 ? null : $availableCount]);
}

Expand Down

0 comments on commit 96e2cc0

Please sign in to comment.