Skip Navigation

[Resuelto] filter range price by country money value

This support ticket is created hace 5 años, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 6 respuestas, tiene 2 mensajes.

Última actualización por Luo Yang hace 5 años, 2 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#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 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

#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:
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

#1330307

maybe it could be possible to use hook wpv_filter_query - and insert there the enlace oculto 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.