Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

E-Commerce Modules

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Adding a 'View All' to pagination options


Reply

5 Posts   1277 Views

Avatar
neilcreagh

16 April 2011 at 1:53am Community Member, 94 Posts

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

Avatar
neilcreagh

22 April 2011 at 1:18am Community Member, 94 Posts

Anyone? Jedateach? Any help would be really appreciated, thanks.

Avatar
Jedateach

25 April 2011 at 1:30pm (Last edited: 25 April 2011 1:31pm), Forum Moderator, 227 Posts

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

Avatar
ciaranhickey

3 May 2011 at 1:08am Community Member, 17 Posts

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

Avatar
neilcreagh

3 May 2011 at 2:10am Community Member, 94 Posts

Thanks guys!