Forums › Forums › Search & Filter Pro › Divide each meta value
Tagged: calculating, dividing values, V3
- This topic has 4 replies, 3 voices, and was last updated 4 years, 9 months ago by
Ross.
-
Anonymous(Private) May 13, 2020 at 1:59 pm #243737
We have a price range slider in some currency based on some meta key. On other language child site we want to have same search silter, but with values calculated in different currency and we don´t have separate meta key for it. Is there some easy way how to divide meta value first and than use it in filtering?
Thanks.
Ross Moderator(Private) May 15, 2020 at 2:57 pm #244179Hi Michal
This could be done, but is a bit of PHP development work – is this something you can tackle? If so, I can give you a nudge in the right direction 🙂
Best
Ross Moderator(Private) May 18, 2020 at 8:56 am #244395Hi Michal
Great stuff 🙂
So, we have a filter here:
https://searchandfilter.com/documentation/action-filter-reference/#filter-input-object
You can find a github link to a full example, but essentially, with this filter you can change the options in your fields, you can change the value + label.I guess you would want to do some check to see the currency, and then generate new values / labels – with some calculations in there to do the conversion.
What is in the value of an option, is what gets added to the URL and ultimately what is searched against in the DB.
Let me knnow how you get on and if you have any further questions.
Thanks
-
AuthorPosts