1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Adding a 'View All' to pagination options
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1082 Views |
-
Adding a 'View All' to pagination options

16 April 2011 at 1:53am
Hi, I've been trying to add a 'View All' to the pagination on a ProductGroup page in the eCommerce module eg.
< Prev | 1 | 2 | 3 | View All | Next >
So that clicking 'View All' would 'break' pagination and display all the products on one long page instead of limiting them.
Can anyone advise as to the best way to achieve this?
Thanks,
Neil -
Re: Adding a 'View All' to pagination options

22 April 2011 at 1:18am
Anyone? Jedateach? Any help would be really appreciated, thanks.
-
Re: Adding a 'View All' to pagination options

25 April 2011 at 1:30pm Last edited: 25 April 2011 1:31pm
Hi Neil,
I'm not sure if we've got appropriate decorator hooks in there yet, which should be the ideal way to do it.
You'd probably need to get into the ProductGroup.php code, and customise the 'ProductsShowable' functiont so that you can disable the result limit. This should return all products, as long as you also start from 0.
Jeremy
-
Re: Adding a 'View All' to pagination options

3 May 2011 at 1:08am
Hi Neil,
You could hardcode a parameter through the View All link such as ?end=1 and, as Jedateach said, then modify the ProductsShowable function to remove the pagination limit IF it detects the param you pass in...
eg.
if(isset($_GET['end'])){
$limit = "";
}
else{
// existing code to handle pagination limits
$limit = (isset($_GET['start']) && (int)$_GET['start'] > 0) ? (int)$_GET['start'].",".self::$page_length : "0,".self::$page_length;
}Hope that helps.
Ciaran
| 1082 Views | ||
|
Page:
1
|
Go to Top |



