In RecurlyJS, there is no way to disable the VAT number field on the checkout form. Many countries don't need a VAT number and therefore should not be forced to display this field.

Comments

sheldonkreger created an issue. See original summary.

sheldonkreger’s picture

Patch.

sheldonkreger’s picture

Assigned: sheldonkreger » Unassigned
Status: Active » Needs review
aburke626’s picture

This looks good! Thanks for the patch. Would you be able to add this for the 8.x branch, as well?

aburke626’s picture

Status: Needs review » Reviewed & tested by the community

aburke626’s picture

Status: Reviewed & tested by the community » Fixed
sheldonkreger’s picture

There is some javascript code starting on line 70 of recurlyjs/recurly-element.js which has some conditional logic. It looks like it tries to hide the element unless an EU country is selected in the country field. However this probably broke during the V3 refactor. It might be worthwhile to clean this up or even fix it.

// VAT is only needed for EU countries.
(function () {
  var country = $('#country');
  var vatNumber = $('#vat-number');
  var euCountries = [
    'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'EE', 'ES', 'FI', 'FR',
    'DE', 'GB', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU', 'MT',
    'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK', 'HR'
  ];

  country.on('change init', function (event) {
    if (~euCountries.indexOf(this.value)) {
      vatNumber.show();
    } else {
      vatNumber.hide();
    }
  }).triggerHandler('init');
})();

})(jQuery);

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.