This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

More that one value in selector

Home Forums Product Support Forums Ajax Search Pro for WordPress Support More that one value in selector

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20824
    parada1280parada1280
    Participant

    Hello, i have a selector with all this options, i need that where it says ANTIOQUIA the valueshould be Apartadó,Bello,El Retiro

    ||Todas**
    ||ANTIOQUIA
    Apartadó||- Apartadó
    Bello ||- Bello
    El Retiro||- El Retiro
    Envigado ||- Envigado
    Itaguí ||- Itaguí
    Medellín ||- Medellín
    Rionegro ||- Rionegro
    Sabaneta ||- Sabaneta
    SantaFé de Antioquia||- SantaFé de Antioquia
    ||CARIBE
    Barranquilla ||- Barranquilla
    Cartagena ||- Cartagena
    Galapa ||- Galapa
    Soledad ||- Soledad
    ||CUNDINAMARCA
    Bogotá ||- Bogotá
    Cajicá ||- Cajicá
    La Calera||- La Calera

    #20840
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Well, that is not possible, the options will be treated as single string or numeric values. It might be however possible using a custom code. I have constructed this to help you out.

    1. Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_query_args', 'asp_cf_filter_multivalue', 10, 1);
    function asp_cf_filter_multivalue( $args ) {
        if ( isset($args['post_meta_filter']) ) {
            foreach($args['post_meta_filter'] as $k => &$v) {
                if ( strpos($v['value'], '::') !== false ) {
                    $v['value'] = explode('::', $v['value']);
                    foreach ( $v['value'] as &$vv )
                        $vv = trim($vv);
                }
            }
        }
        return $args;
    }

    2. On lines, where you want multiple values, use this syntax:

    Apartadó::Bello::El Retiro||ANTIOQUIA

    Basically just separate the values by ‘::’, and that should do it. I cannot guarantee this solution will work in all cases, but it is worth trying.

    I have noted this as a request, and will most likely implement in the upcoming release.

    #21586
    parada1280parada1280
    Participant

    Thanks, but it doesnt work, justo dont load any result (in autopopulate or in custom field). The search just stop working

    #21593
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Well, I’m not sure then. This feature will be added into the upcoming release of the plugin, once updated, then it will work. It will be released within 48 hours (version 4.15). You will get a notification from codecanyon once it is ready to update.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘More that one value in selector’ is closed to new replies.