Jump to content

[URGENT] Commerce 4.6.11: bug with BusinessAddress


Go to solution Solved by Marc Stridgen,

Recommended Posts

Hi Invision,

There is a very problematic bug with Business Address on Commerce 4.6.11.

Here is what happens:

When Commerce is configured to use a business tax type (for instance "European Union VAT Rates"), then, during registration, the type of address used is /nexus/dev/html/global/form/businessAddress.phtml

Then, it is possible to choose a “Consumer” or “Business” address.

1st problem:
When choosing the “Business” address type, the field for the company name does not appear when the chosen country is outside the European Union.

Thus, an American user who chooses a Business address cannot fill in his company name.

This problem comes from the javascript ips.forms.businessAddressVat.js, at line 28:

changeRelevantField: function () {
  if ( this.scope.find('[data-role="addressTypeRadio"][value="business"]').is(':checked') && ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB','FX','GP','MQ','RE','BL','GF','MF','NC','PF','PM','TF','YT','WF'].indexOf( this.scope.find('[data-role="countrySelect"]').val() ) !== -1 ) {
    this.scope.find('[data-role="vatField"]').show();
    this.scope.find('[data-role="business"]').show();
  } else {
    this.scope.find('[data-role="vatField"]').hide();
    this.scope.find('[data-role="business"]').hide();
  }
}

=> The business name is only displayed for UE countries.
It should be displayed for all countries. This is the tax field that should be displayed only for EU countries.


2nd problem, much more important:

When submitting the form, an error is thrown: “A business name is required”.

However, this problem cannot be corrected, because the field for the Company name does not appear:

 

BusinessAddress-bug.thumb.png.ca1683a92e86c556819ad52fb0fcfec2.png

 

 

It is therefore impossible to validate the form.

This problem comes from the PHP script /nexus/sources/Form/BusinessAddress.php, at line 121:

if ( $this->value->business === '' )
{
	throw new \DomainException('cm_business_name_required');
}

 

An error is thrown, with no condition on the selected country.
Therefore, a user with a country outside the UE cannot validate the form, as he has no Business field to fill in.

 

=> So, the field for the Company name must therefore be displayed for all countries, and not only for those of the European Union, otherwise the user cannot validate the form.

Thank you!

Edited by LaCollision
Link to comment
Share on other sites

  • 2 weeks later...
On 3/21/2022 at 1:01 PM, LaCollision said:

Hi Invision,

There is a very problematic bug with Business Address on Commerce 4.6.11.

Here is what happens:

When Commerce is configured to use a business tax type (for instance "European Union VAT Rates"), then, during registration, the type of address used is /nexus/dev/html/global/form/businessAddress.phtml

Then, it is possible to choose a “Consumer” or “Business” address.

1st problem:
When choosing the “Business” address type, the field for the company name does not appear when the chosen country is outside the European Union.

Thus, an American user who chooses a Business address cannot fill in his company name.

This problem comes from the javascript ips.forms.businessAddressVat.js, at line 28:

changeRelevantField: function () {
  if ( this.scope.find('[data-role="addressTypeRadio"][value="business"]').is(':checked') && ['AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB','FX','GP','MQ','RE','BL','GF','MF','NC','PF','PM','TF','YT','WF'].indexOf( this.scope.find('[data-role="countrySelect"]').val() ) !== -1 ) {
    this.scope.find('[data-role="vatField"]').show();
    this.scope.find('[data-role="business"]').show();
  } else {
    this.scope.find('[data-role="vatField"]').hide();
    this.scope.find('[data-role="business"]').hide();
  }
}

=> The business name is only displayed for UE countries.
It should be displayed for all countries. This is the tax field that should be displayed only for EU countries.


2nd problem, much more important:

When submitting the form, an error is thrown: “A business name is required”.

However, this problem cannot be corrected, because the field for the Company name does not appear:

 

BusinessAddress-bug.thumb.png.ca1683a92e86c556819ad52fb0fcfec2.png

 

 

It is therefore impossible to validate the form.

This problem comes from the PHP script /nexus/sources/Form/BusinessAddress.php, at line 121:

if ( $this->value->business === '' )
{
	throw new \DomainException('cm_business_name_required');
}

 

An error is thrown, with no condition on the selected country.
Therefore, a user with a country outside the UE cannot validate the form, as he has no Business field to fill in.

 

=> So, the field for the Company name must therefore be displayed for all countries, and not only for those of the European Union, otherwise the user cannot validate the form.

Thank you!

We reported the same issue in a support ticket on March 16 2021 (subject "Subscriptions. Business name filed hidden". Misspell excuse hereby submitted :-).

We are EU based, and since our target group is global this bug effectively stops us from going live. Underlining this in the ticket we got this swift response a couple of days later:

(Quote)
Hello,

Thank you for bringing this issue to our attention. I have investigated the issue you reported and the problem appears to be a bug in the current release of Invision Community.

I have submitted a potential solution for the issue described here and upon review by the development team the fix should be included in an upcoming release of Invision Community. Unfortunately, at this time I am unable to say exactly which release this fix will be included in.

We do apologize for the trouble. Thank you again for letting us know, and don't hesitate to let us know if you run into any other problems!



--
Daniel Fatkic
Invision Community Support

(Unquote)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...