$(document).ready(function() {
  if ($("#product_taxon_ids").length > 0) {
    $("#product_taxon_ids").select2({
      placeholder: Spree.translations.taxon_placeholder,
      multiple: true,
      initSelection: function(element, callback) {
        return $.getJSON(Spree.routes.taxons_search + "?ids=" + (element.val()), null, function(data) {
          return callback(data);
        })
      },
      ajax: {
        url: Spree.routes.taxons_search,
        datatype: 'json',
        data: function(term, page) {
          return { q: term }
        },
        results: function (data, page) {
          return { results: data }
        }
      },
      formatResult: function(taxon) {
        return taxon.pretty_name
      },
      formatSelection: function(taxon) {
        return taxon.pretty_name
      }
    })
  }
})

$(document).ready(function() {
  if ($("#product_taxon_ids").length > 0) {
    $("#product_taxon_ids").select2({
      placeholder: Spree.translations.taxon_placeholder,
      multiple: true,
      initSelection: function(element, callback) {
        return $.getJSON(Spree.routes.taxons_search + "?ids=" + (element.val()), null, function(data) {
          return callback(data);
        })
      },
      ajax: {
        url: Spree.routes.taxons_search,
        datatype: 'json',
        data: function(term, page) {
          return { q:
            { name_cont: term }
          }
        },
        results: function (data, page) {
          return { results: data }
        }
      },
      formatResult: function(taxon) {
        return taxon.pretty_name
      },
      formatSelection: function(taxon) {
        return taxon.pretty_name
      }
    })
  }
})

Correct parameter parsing for taxon_autocomplete
Correct parameter parsing for taxon_autocomplete
