magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

VAT field can't be disabled in customer registration form #35239

Open johnulecan opened 2 years ago

johnulecan commented 2 years ago

Preconditions (*)

  1. 2.4.x
  2. 2.3.x

Steps to reproduce (*)

  1. Go to Admin->Store->Configuration->Customer and set Show Tax/VAT Number either Optional or Required in the Name and Address Options section
  2. Set Show VAT Number on Storefront to No in Admin->Store->Configuration->Customer Create New Account Options section

Expected result (*)

  1. VAT field shouldn't be displayed in the customer registration form in front-end.

Actual result (*)

  1. VAT field is still visible in the customer registration field.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @johnulecan. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

twosg commented 2 years ago

Hi, taxvat and vat_id are different fields. taxvat belongs to the customer entity, vat_id is for the customer address entity. The settings should not depend on each other and work correctly as intended.

The setting Show VAT Number on Storefront won't have any effect on the registration page until you enable the address fields to show on that page.

johnulecan commented 2 years ago

Hi, taxvat and vat_id are different fields. taxvat belongs to the customer entity, vat_id is for the customer address entity. The settings should not depend on each other and work correctly as intended.

The setting Show VAT Number on Storefront won't have any effect on the registration page until you enable the address fields to show on that page.

Hey @twosg Thank you for the feedback. It makes sense for customer address forms, but, on registration form you should be able to remove the taxvat field without editing register.phtml. Show Tax/VAT Number settings are located in the Address Options section. In the Create New Account Options section we should be able to set taxvat visibility on registration form. At this point, if you enable Show Tax/VAT Number for address forms, taxvat field will be rendered in the registration form also (for a B2B + B2C store you don't want to ask for taxvat in the customer registration form, but you rather want to provide customers the possibility to add both a business and a personal billing/shipping address).

twosg commented 2 years ago

I am not against improvements on this but:

You are able to hide the field in the register.phtml by setting Name and Address Options -> Show Tax/VAT Number to No. This will generally hide the field, if you want to hide it only for the register.phtml then you need to touch the template. I agree that a bit more fine-tunable settings would be preferrable, but the setting at Create new account options -> Show VAT Number on Storefront is there to control another field called vat_id. It has nothing to do with the taxvat field and therefore should not control the visibility of it.

The main source of confusion about these fields is that back in the Magento1 days (until version 1.7) there only was the taxvat field and vat_id did not exist. Nowadays the field label should be renamed to Tax Number instead of Tax/VAT Number, because we have an own field for the VAT Number on the customer address with vat_id.

justpeeet commented 2 years ago

I am not against improvements on this but:

You are able to hide the field in the register.phtml by setting Name and Address Options -> Show Tax/VAT Number to No. This will generally hide the field, if you want to hide it only for the register.phtml then you need to touch the template. I agree that a bit more fine-tunable settings would be preferrable, but the setting at Create new account options -> Show VAT Number on Storefront is there to control another field called vat_id. It has nothing to do with the taxvat field and therefore should not control the visibility of it.

The main source of confusion about these fields is that back in the Magento1 days (until version 1.7) there only was the taxvat field and vat_id did not exist. Nowadays the field label should be renamed to Tax Number instead of Tax/VAT Number, because we have an own field for the VAT Number on the customer address with vat_id.

That's not right. If you are using Magento 2 as headless system I am relying on the address settings. So If I am not able to disable this I will get an additional field for the customer address which shouldn't be there cause the setting is not working correctly. Changing the template won't help at this point cause the possibility to disable the field in the customer address settings should work as intended

twosg commented 2 years ago

I guess we are talking past each other.

johnulecan wants to hide the taxvat field of the customer account with the setting Create new account options -> Show VAT Number on Storefront. But this setting controls the visibility of the vat_id field of the customer address.

To hide the taxvat field you simply need to use Name and Address Options -> Show Tax/VAT Number and set it to No.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 2 years ago

Hi @johnulecan , We tried to reproduce the issue on Magento 2.4 Develop & 2.4.3p1 instance. As per provided steps issue is reproducible in below test scenarios.

Scenario1:

  1. Set 'Optional' to "Show Tax/VAT Number" field in Customer name & address options.
  2. Set 'NO' to field "Show VAT Number on Storefront" in Create new Account options
  3. Save
  4. Go to frontend and click on customer registration
  5. verify the VAT Number field

Actual: Tax or Vat Number field displayed on customer registration form.

Screenshot 2022-04-01 at 9 09 56 AM Screenshot 2022-04-01 at 9 13 28 AM Screenshot 2022-04-01 at 9 15 08 AM

Scenario2:

  1. Set 'Required' to "Show Tax/VAT Number" field in Customer name & address options.
  2. Set 'NO' to field "Show VAT Number on Storefront" in Create new Account options
  3. Save
  4. Go to frontend and click on customer registration
  5. verify the VAT Number field

Actual: Tax or Vat Number field displayed on customer registration form.

Screenshot 2022-04-01 at 8 57 31 AM Screenshot 2022-04-01 at 8 59 55 AM Screenshot 2022-04-01 at 9 01 57 AM

Scenario3:

  1. Set 'NO' to "Show Tax/VAT Number" field in Customer name & address options.
  2. Set 'NO' to field "Show VAT Number on Storefront" in Create new Account options
  3. Save
  4. Go to frontend and click on customer registration
  5. verify the VAT Number field

Actual: Tax or Vat Number field is not displayed on customer registration form.

Screenshot 2022-04-01 at 9 06 09 AM

As per first two test scenarios's issue is reproducible. Hence confirming it.

github-jira-sync-bot commented 2 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-2743 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 years ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

engcom-Bravo commented 6 days ago

Hi @johnulecan,

Thanks for your reporting and collaboration.

We have reverified the issue in Latest 2.4-develop instance and the issue is still reproducible.Kindly refer the screenshots.

Create-New-Customer-Account-11-18-2024_10_15_AM

VAT field is still visible in the customer registration field.

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 6 days ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13364 is successfully created for this GitHub issue.

m2-assistant[bot] commented 6 days ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.