Tell us what you are trying to do?
I have a toolset field "fave_property_price" of a real estate property
I made a range parametric filter in a view to filter a range of price (min,max)
i use a shortcode [wpcs_price meta_value=fave_property_price] to convert the amount by country coin (there is a switcher for countries money from the plugin)
How should i make the range filter works with the shortcode to range according to the country money value?
Hello,
Please elaborate the questions with more details, how do you setup the range filter? Two single line inbox boxes?
How do you want to make the range filter works with the shortcode to range according to the country money value?
this is my filter toolset code for price
<div class="col-sm-4">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="wpv-fave_property_price_min">[wpml-string context="wpv-views"]Min Price[/wpml-string]</label>
[wpv-control-postmeta field="fave_property_price" url_param="wpv-fave_property_price_min" placeholder="Price Range"]
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label for="wpv-fave_property_price_max">[wpml-string context="wpv-views"]Max Price[/wpml-string]</label>
[wpv-control-postmeta field="fave_property_price" url_param="wpv-fave_property_price_max" placeholder="Price Range"]
</div>
</div>
</div>
</div>
now, i use enlace oculto plugin for currencies.
i have a shortcode like [wpcs_price value=20], or [wpcs_price meta_value=my_any_meta_field_key] for transforming the currencies.
lets say the DB of fave_property_price is saved in ILS (israeli shekls) and the site is swithed to us$
I 'd like to make toolset filter the range price by ILS currency (native DB) even if the user is filtering by entrying dolar price range
Thanks for the details, there isn't such kind of built-in feature within Toolset Views plugin, you might consider custom codes, for example:
1) Add a hidden input field "countries-money" into the custom search form:
enlace oculto
2) When user change the value in switcher for countries money, setup JS codes to setup value of above "countries-money" to:
- USD
- ILS
...
3) after user fill values into input boxes "Min Price" and "Max Price", submit the form, use filter hook "wpv_filter_query" to trigger a PHP function
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
In this PHP function get the field "countries-money" value, use it to change the field filter value range:
https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters
maybe it could be possible to use hook wpv_filter_query - and insert there the enlace oculto shortcode to make the exchange?
could you be more specific in the solution code purpose?
According to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/
You can check it with our Toolset Contractors:
https://toolset.com/contractors/
If you still need assistance for it, please provide a test site with the same problem, fill below private message box with login details and FTP access, also point out the problem page URL and view URL, I can setup a demo for you.