Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › taxonomy settings in custom redirect url › Reply To: taxonomy settings in custom redirect url
Hi,
Well, the base URL is passed in as an argument, and it’s not possible to change it from outsite scope (ex. custom script). The only way to make this work is to implement the change within the core code.
As this is a modification, I cannot promise anything, but you could try changing the parseCustomRedirect method within wp-content/plugins/ajax-search-pro/js/nomin/jquery.ajaxsearchpro.js from the original, to this:
parseCustomRedirectURL: function(url ,phrase) {
var $this = this;
var u = url.replace(/\{phrase\}/g, asp_nice_phrase(phrase));
var items = u.match(/\{(.*?)\}/g);
if ( items !== null ) {
$.each(items, function(i, v){
v = v.replace(/[{}]/g, '');
var node = $('input[type=radio][name*="aspf\[' + v + '_"]:checked', $this.n.searchsettings);
if ( node.length == 0 )
node = $('input[type=text][name*="aspf\[' + v + '_"]', $this.n.searchsettings);
if ( node.length == 0 )
node = $('input[type=hidden][name*="aspf\[' + v + '_"]', $this.n.searchsettings);
if ( node.length == 0 )
node = $('select[name*="aspf\[' + v + '_"]:not([multiple])', $this.n.searchsettings);
if ( node.length == 0 )
node = $('input[type=radio][name*="termset\[' + v + '_"]:checked', $this.n.searchsettings);
if ( node.length == 0 )
node = $('input[type=text][name*="termset\[' + v + '_"]', $this.n.searchsettings);
if ( node.length == 0 )
node = $('input[type=hidden][name*="termset\[' + v + '_"]', $this.n.searchsettings);
if ( node.length == 0 )
node = $('select[name*="termset\[' + v + '_"]:not([multiple])', $this.n.searchsettings);
if ( node.length == 0 )
return true; // Continue
var val = node.val();
val = "" + val; // Convert anything to string, okay-ish method
u = u.replace('{' + v + '}', val);
});
}
return u;
},
You will have to change the script loading method to the ‘Non minified’ on the compatibility options, so that the changes have effect.
Then try the variables within the custom redirect URL, like so: https://i.imgur.com/37zQxs5.png
This only affects the drop-down boxes, the slider is a much more complicated. Let me know if this works at least with the drop down boxes.