Skip to Content
Menu
This question has been flagged
1407 Views

Hey,

I created some extra filters in my webshop. These filters are checkboxes. For example, a visitor should be able to filter on multiple categories at the same time.

After selecting a category, the user is redirected to a new URL with in the URL the parameters so that it will end up like this:


http://localhost:8069/shop?filter_categories[]=2& filter_categories[]=4


When filtering the products, I can catch these parameters and do my thing with it:

filterCategories = request.httprequest.args.getlist('filter_categories[]') or []


But the product pager doesn't see this as an array, and generates the url only with one filter_categories parameters, resulting in this new url:

http://localhost:8069/shop/page/2?filter_categories[]=2 

I've looked into the portal controller, the pager-function:

def pager(url, total, page=1, step=30, scope=5, url_args=None):

And indeed, the urg_args only contain the first filter_categories[]=2 and not the filter_categories[]=4 parameter.

Any direction to a solution would be nice.


Thanks.




Avatar
Discard
Related Posts Replies Views Activity
1
May 24
690
2
Feb 24
646
0
Dec 23
315
0
Apr 23
527
6
Feb 23
16624