You are here:  » Filter on select


Filter on select

Submitted by henk on Mon, 2012-10-22 18:46 in

Sorry,

I think my last question :) is it possible to make the filter on select and filter the filterresults.

Thx
Henk

Submitted by support on Tue, 2012-10-23 09:46

Hello Henk,

Sure! The actual filter form HTML is in the Main / Search Filters Widget template in wp-admin > Settings > PriceTapestry.org.

Within that template, look for each fileter's opening <select... tag for example:

<select name='pto_merchantFilter'>

...and REPLACE with:

<select name='pto_merchantFilter' onchange='JavaScript:this.form.submit();'>

(and same for pto_categoryFilter and pto_brandFilter of course)

Cheers,
David.
--
PriceTapestry.com

Submitted by henk on Tue, 2012-10-23 12:08

It doesn´t refresh and:

When you select category click on refresh/submit the brands doesn't filter.

Thx
Henk

Submitted by support on Tue, 2012-10-23 12:21

Sorry Henk - "form" is an object not a function - the replacement should be:

<select name='pto_merchantFilter' onchange='JavaScript:this.form.submit();'>

(corrected above)

Cheers,
David.
--
PriceTapestry.com

Submitted by henk on Tue, 2012-10-23 12:37

Thx, the refreshing is working, but it doesn't changing the filter result:

its now or filter on merchant or filter on brands or filter on.

Thx
Henk

Submitted by support on Tue, 2012-10-23 13:18

Hello Henk,

The filter clause should be added to the WHERE clause used to build the filter lists. In your pto_search.php look for the following code at line 315:

    $pto_searchWhere = $where;

...and REPLACE with:

    $pto_searchWhere = $where.$priceWhere;

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by henk on Tue, 2012-10-23 13:33

Works like a..... :)

Thx
Henk