I configured the extension tt_address in my page. I need to filter the address by its year. So I build a select box. I need to append some query parameter with its url to access in controller for implementing the filter. The functionality is done successfully. But realurl is not working for this particular functionality.
main.js
function initYearFilter() {
var selectedItem = sessionStorage.getItem('year');
if (selectedItem !== null) {
$('.year-filter select').val(selectedItem);
}
$('.year-filter select').on('change', function () {
var loc = location.href.match(/.*people\/alumni\/+/)[0],
url;
if ($(this).val() == 'reset') {
url = loc + '?no_cache=1';
} else {
url = loc + '?ts_address[year]=' + $(this).val() + '&no_cache=1';
}
sessionStorage.setItem("year", $(".year-filter select").first().val());
window.location.href = url;
});
}
My realurl config
'postVarSets' => array(
'_DEFAULT' => array(
'year' => array(
array(
'GETvar' => 'ts_address[year]',
),
),
),
)