1 Attachment(s)
How do I modify paging's display mode?
Hello, every friend! I meet a question that can't be sloved, I hope for some help about it, thanks!
I want alter paging's display mode. for example, I want alter it from "Displaying 1 to 10 (of 24 products)" to "Total 24 Products", which file should I change, how do modify it?
Attachment 16098
Re: How do I modify paging's display mode?
If I got your page correct then
admin > config > Maximum Values > Maximum Number of Products to list per page on main page > set to higher number
Re: How do I modify paging's display mode?
Thank kobra's answer, It is a very good method! But I couldn't fully express the question before, I only need display "Total 24 Products", and don't change display number of each page.
Re: How do I modify paging's display mode?
Problem has been sloved, It need add below code in tpl_modules_product_listing.php.
<?php
$allnum=$db->Execute($listing_sql);
$total=$allnum->RecordCount();
echo 'Total' . $total . 'Products';
?>
Re: How do I modify paging's display mode?
Quote:
Originally Posted by
sfgl
Problem has been sloved, It need add below code in tpl_modules_product_listing.php.
<?php
$allnum=$db->Execute($listing_sql);
$total=$allnum->RecordCount();
echo 'Total' . $total . 'Products';
?>
If you have a large site, this code can make your site slow.
Re: How do I modify paging's display mode?
Quote:
Originally Posted by
cvhainb
If you have a large site, this code can make your site slow.
I agree with you.
To modify paging's display code, edit includes/classes/split_page_results.php -> display_count() method, line# 156
PHP Code:
return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);
to
PHP Code:
return sprintf('Total %d Products', $this->number_of_rows);
Re: How do I modify paging's display mode?
Thank cvhainb and DrInt's reply! DrInt offer a better solution, I decide to adopt his method.
Re: How do I modify paging's display mode?
The reply from DrInt will break your pagination on other pages. You should not touch the split_page_results.php file.
Re: How do I modify paging's display mode?
Quote:
Originally Posted by
DrByte
The reply from DrInt will break your pagination on other pages. You should not touch the split_page_results.php file.
DrByte sensei you're right; a better way to do this,
edit includes/languages/english.php, find the line below:
PHP Code:
define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Displaying <strong>%d</strong> to <strong>%d</strong> (of <strong>%d</strong> products)');
modify like :
PHP Code:
define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', '<span style="display:none">%d%d</span>Total %d Products');
Re: How do I modify paging's display mode?
Or assuming that the above works, could maybe shorten it up further:
Code:
define('TEXT_DISPLAY_NUMBER_OF_PRODUCTS', 'Total %3$d Products');
This would reduce any unnecessary output; however, may make refinding this text a little harder to do than before...