Skip to content

Commit

Permalink
fix пагинации ?page={page}
Browse files Browse the repository at this point in the history
  • Loading branch information
oclabs committed Sep 20, 2018
1 parent 9b00ac3 commit fac2b03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions upload/system/library/pagination.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// * @copyright OPENCART.PRO 2011 - 2017.
// * @copyright OPENCART.PRO 2011 - 2016.
// * @forum http://forum.opencart.pro
// * @source See SOURCE.txt for source and other copyright.
// * @license GNU General Public License version 3; see LICENSE.txt
Expand Down Expand Up @@ -38,10 +38,10 @@ public function render() {
$output = '<ul class="pagination">';

if ($page > 1) {
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_first . '</a></li>';

if ($page - 1 === 1) {
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $this->text_prev . '</a></li>';
} else {
$output .= '<li><a href="' . str_replace('{page}', $page - 1, $this->url) . '">' . $this->text_prev . '</a></li>';
}
Expand Down Expand Up @@ -71,7 +71,7 @@ public function render() {
$output .= '<li class="active"><span>' . $i . '</span></li>';
} else {
if ($i === 1) {
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}'), '', $this->url) . '">' . $i . '</a></li>';
$output .= '<li><a href="' . str_replace(array('&amp;page={page}', '&page={page}', '?page={page}'), '', $this->url) . '">' . $i . '</a></li>';
} else {
$output .= '<li><a href="' . str_replace('{page}', $i, $this->url) . '">' . $i . '</a></li>';
}
Expand Down

0 comments on commit fac2b03

Please sign in to comment.