$(document).ready(function () {
  var token = $('body').data('token');

  $("#js-btn-filter").click(function () {

    url = 'index.php?route=catalog/category&token=' + token;

    var filter_name = $('input[name=\'filter_name\']').attr('value');

    if (filter_name) {
      url += '&filter_name=' + encodeURIComponent(filter_name);
    }

    var filter_code = $('input[name=\'filter_code\']').attr('value');

    if (filter_code) {
      url += '&filter_code=' + encodeURIComponent(filter_code);
    }

    var filter_id_futura = $('input[name=\'filter_id_futura\']').attr('value');

    if (filter_id_futura) {
      url += '&filter_id_futura=' + encodeURIComponent(filter_id_futura);
    }

    var filter_status = $('input[name=\'filter_status\']:checked').attr('value');

    if (filter_status != '*') {
      url += '&filter_status=' + encodeURIComponent(filter_status);
    }

    location = url;

  });
});
