Skip Navigation

[Resolved] filter range price by country money value

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Luo Yang 5 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1329713

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?

#1329897

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?

#1330207

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 hidden link 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

#1330251

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:
hidden link

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

#1330307

maybe it could be possible to use hook wpv_filter_query - and insert there the hidden link shortcode to make the exchange?

#1330925

could you be more specific in the solution code purpose?

#1331027

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.