Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › More that one value in selector
- This topic has 3 replies, 2 voices, and was last updated 7 years, 2 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 17, 2019 at 8:30 pm #20824
parada1280
ParticipantHello, 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 CaleraJanuary 18, 2019 at 11:00 am #20840Ernest Marcinko
KeymasterHi,
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||ANTIOQUIABasically 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.
March 12, 2019 at 8:10 pm #21586parada1280
ParticipantThanks, but it doesnt work, justo dont load any result (in autopopulate or in custom field). The search just stop working
March 13, 2019 at 9:33 am #21593Ernest Marcinko
KeymasterWell, 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.
-
AuthorPosts
- The topic ‘More that one value in selector’ is closed to new replies.