Forums › Forums › Search & Filter Pro › Range – Slider not working
Tagged: range slider
- This topic has 12 replies, 2 voices, and was last updated 10 years, 3 months ago by
Ross.
-
Ross Moderator(Private) March 23, 2015 at 8:40 am #13834
Hey Ryan
Ok so lets try a couple of things…
1) remove the other plugin you installed
2) create a new meta field, assign some values to a few posts (call it something else, and only enter values as whole numbers (ie2
,10
etc – no currency symbols and no decimal places).
3) create a new field in your search from for S&F – setup as range sliderLet me know when you have done this and if its working, if its not I’ll need to see a link in order to be able to help further.
Thanks
Ross Moderator(Private) March 24, 2015 at 1:12 pm #13910*edit* making this visible for any users with WCK
OK I can see the problem here
WCK is storing the meta data in a non standard way…
Basically, if you had a price meta field, you would expect the value of this field to only contain the price… but it does not..
Eg… Woocommerce adds a price custom field to all products, the data as an example would look like this if you did a
var_dump
like we did for your site:["_price"]=> array(1) { [0]=> string(1) "10" }
This means the price was set to 10.
What WCK is doing is this:
["rosstest"]=> array(1) { [0]=> string(40) "a:1:{i:0;a:1:{s:8:"rosstest";s:2:"10";}}" }
Notice in the first example we have
string(1) "10"
And in the test field I made for your site:
string(40) "a:1:{i:0;a:1:{s:8:"rosstest";s:2:"10";}}"
It is storing a lot of extra information in the field, such as the name as well as the value (and it’s serialising the data) – this makes it unsearchable – you can’t even use WP_Query to create a query on the meta data generated by that plugin – I personally think this is a very bad implementation – but I guess they may have solutions for this in their docs.
In this case, I would recommend to use the Advanced Custom Fields plugin – I’ve used it many times, and it stores meta data cleanly and doesn’t stop it from being searchable – I’m sure there are plenty of others, it just seems like WCK is making life difficult!
Hope that makes sense.
Thanks
-
AuthorPosts