Post by labeshops » Tue May 27, 2014 7:50 pm

The built in filters module works great once you get it all configured, but one major thing it lacks is a "clear filters" button or link to reset them all to off when you want to see all items again.

Haven't found any mods to do this yet.

Running Opencart v2.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MarketInSG » Wed May 28, 2014 10:56 pm

You can pretty easily add in a small link button to uncheck the checkboxes (jquery, search for the checkboxes and uncheck them) or to reload the category page without the filter attributes :)


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by labeshops » Wed May 28, 2014 11:01 pm

I really don't know jquery at all, so sounds good, but not a clue how to do it.

I also tried the link thing, but couldn't get the link to auto grab correctly for the category.

Running Opencart v2.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by MarketInSG » Thu May 29, 2014 9:34 am

for link, you can just add this to the controller to call for the category once again.

Code: Select all

$this->data['reload'] = $this->url->link('product/category', 'path=' . $this->request->get['path']);
then add <?php echo $reload; ?> as a link for your button.

As for jQuery solution, you can add a class to the checkboxes, perhaps class="filter_checkboxes", then add a button into the template

Code: Select all

onclick="$('.filter_checkboxes').attr('checked', 'false');"


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by labeshops » Thu May 29, 2014 7:55 pm

Thanks @marketinsg. I used the link method and it works perfectly!

I still think this should be a standard part of the features module, but it solves the issue.

Running Opencart v2.2 with multi-stores from https://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by stefg » Sun Nov 24, 2019 6:53 pm

How can we clear all filters at once in opencart 3?

New member

Posts

Joined
Fri Oct 18, 2019 7:25 pm
Who is online

Users browsing this forum: No registered users and 5 guests