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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

SS-Shop: how to show all products in one page


Go to End


4 Posts   2503 Views

Avatar
suoko

Community Member, 4 Posts

11 May 2014 at 10:05am

Edited: 11/05/2014 10:06am

Currently ss-shop is set to paginate 12 products per page.
I'd like to add a button near "previous ... 1 ... 2 ... 3 .... next" that says "show all".
I found the option "protected $limitItems = true" in the paginatedlist.php file.
Is this the only viable way to do so ?

I would also like to customize the number of shown products which is now 12.

Thanks

Avatar
thomas.paulson

Community Member, 107 Posts

15 May 2014 at 4:24am

class ProductCategory extends Page {

private static $page_length = 6;

}

you can hack the code, to update page_length and do database rebuld ie dev/build, but this is not ideal solution. when updating the module, we have edit the code again.

Avatar
thomas.paulson

Community Member, 107 Posts

17 May 2014 at 2:43am

Edited: 17/05/2014 2:43am

Please ignore my last post,

you can change the pagination limit by using the setter method

// set pagination limit
ProductCategory::config()->page_length = 6;

Add the above code in mysite/_config.php

reference
http://doc.silverstripe.com/framework/en/topics/configuration

Thanks

Avatar
Jedateach

Forum Moderator, 238 Posts

7 October 2014 at 9:50am

Hey guys,

I've just seen this, so I have adjusted the page_length config to show all products if it is set to 0.

https://github.com/burnbright/silverstripe-shop/commit/db5d5ad7b35d6db9f8d96c1fa3ad761ebca421c3

Hope that helps.
Jeremy