for example: Showing 1 to 15 of 22 (2 Pages)
get the number 22
Electronic Components: integrated circuits, ic, semiconductors, transistors, thyristors, fuses, resistors, diodes, capacitors & more.
buy & sell transistors & mosfet
Find:
Code: Select all
public $total = 0;
Code: Select all
public $end = 0;
Code: Select all
for ($i = $start; $i <= $end; $i++) {
Code: Select all
if (isset($end)) {
$this->end = $end;
}
Code: Select all
$data['pagination_end'] = $pagination->end;
Code: Select all
{% if pagination_end %}
{{ pagination_end }}
{% endif %}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
but it only shows the number of total pages.
i need to get the number of total products.
can you help again?
Electronic Components: integrated circuits, ic, semiconductors, transistors, thyristors, fuses, resistors, diodes, capacitors & more.
buy & sell transistors & mosfet
Code: Select all
$data['pagination_end'] = $pagination->end;
Code: Select all
$data['pagination_end'] = $pagination->total;
and there is no need to change php code in system/library/pagination.php
in template, just add {{ pagination_end }} anywhere if you like.
Electronic Components: integrated circuits, ic, semiconductors, transistors, thyristors, fuses, resistors, diodes, capacitors & more.
buy & sell transistors & mosfet
Which controller is mentioned here below?straightlight wrote: ↑Tue Sep 25, 2018 5:28 amIn OC v3.1.0.0, the system/library/pagination.php file will be abolished as it will be handled by a controller file instead. However, here's a tweak since the new version is still alpha:
Find:
add below:Code: Select all
public $total = 0;
Then, find:Code: Select all
public $end = 0;
add above:Code: Select all
for ($i = $start; $i <= $end; $i++) {
Then, from your controller, you could use:Code: Select all
if (isset($end)) { $this->end = $end; }
Finally, in your TWIG file, you could use:Code: Select all
$data['pagination_end'] = $pagination->end;
This should resolved the issue.Code: Select all
{% if pagination_end %} {{ pagination_end }} {% endif %}
- Then, from your controller, you could use:
Code: Select all
$data['pagination_end'] = $pagination->end;
You could take a look at the master branch on the Github Opencart repository: admin/controller/common/pagination.php and catalog/controller/common/pagination.php file.coldnsky wrote: ↑Thu Mar 24, 2022 3:45 amWhich controller is mentioned here below?straightlight wrote: ↑Tue Sep 25, 2018 5:28 amIn OC v3.1.0.0, the system/library/pagination.php file will be abolished as it will be handled by a controller file instead. However, here's a tweak since the new version is still alpha:
Find:
add below:Code: Select all
public $total = 0;
Then, find:Code: Select all
public $end = 0;
add above:Code: Select all
for ($i = $start; $i <= $end; $i++) {
Then, from your controller, you could use:Code: Select all
if (isset($end)) { $this->end = $end; }
Finally, in your TWIG file, you could use:Code: Select all
$data['pagination_end'] = $pagination->end;
This should resolved the issue.Code: Select all
{% if pagination_end %} {{ pagination_end }} {% endif %}
- Then, from your controller, you could use:
Code: Select all
$data['pagination_end'] = $pagination->end;
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Users browsing this forum: No registered users and 262 guests