Is it possible to send me a link to your registration page?
It would help if I could look at the page directly so I can view its code and see what is happening there,
I wonder if you may have multiple VAT fields there on the page - if so, that could be the issue, as the registration currently only supports 1 VAT field per page.
I noticed that in the front-end account details there is a display problem: the two VAT number fields and the codice univoco field are displayed regardless of whether it is in Italy or not. However, it works correctly because the VAT number field for Italy is mandatory and validated only for the account based in Italy.
I looked into this - unfortunately it is a bit difficult technically to make our plugin support multiple VAT fields at the moment - many changes are needed to our code.
However, I worked on a code snippet to help you set the VAT field as only required for Italy.
To enable this:
1. In B2BKing -> Registration Fields -> enable only 1 VAT field. Make that field required. Select all countries that should have VAT (including Italy)
thank you very much, I solved the VAT number field problem. instead, for the Codice Univoco field, is there a way to link the display of the field based on the selected country without necessarily having it linked to a VAT number?
Do you mean to hide / show that field on the registration form, depending on which country is selected?
By default there is no feature for it, but I believe I can adjust the previous code snippet to make it do that. For that, just let me know what countries you'd like it to show for.
Is that on the my account page -> account details tab?
There we do not have the country, so I don't think we have a way to make that work there. For that area, I can only suggest setting the field as "non-editable", so it can no longer be edited after the initial registration:
It would also be important to make sure to clear all site caches. When I go to https://staging3.gioielloliquido.com/pagamento/ I do not see the field so I wonder whether this could be related to a caching problem. I'd suggest trying to see if it works for you with a new browser.
I created the field CODICE UNIVOCO which should only be visible when selecting ITALY, but it's visible when selecting any country
I attach the settings for the field: campo-1.png and campo-2.png
thank you very much and have a nice day
Attached files: 1.png
grecia.png
campo-1.png
campo-2.png
Hi there,
Is it possible to send me a link to your registration page?
It would help if I could look at the page directly so I can view its code and see what is happening there,
I wonder if you may have multiple VAT fields there on the page - if so, that could be the issue, as the registration currently only supports 1 VAT field per page.
Kind regards,
Stefan
yes, i have field PARTITA IVA (VAT) too....
so it's not possible to have more field of the same type, for example: VAT field required for Italy and another one not required for other countries?
Thank you, that seems to be the issue then, that the plugin currently doesn't support multiple VAT fields.
Please let me check to see if there's a way we can make an update so it supports it - seems that would be quite helpful.
If not, I will provide a code snippet to make only Italy required,
Please let me get back to you on this after we've looked into this,
I noticed that in the front-end account details there is a display problem: the two VAT number fields and the codice univoco field are displayed regardless of whether it is in Italy or not. However, it works correctly because the VAT number field for Italy is mandatory and validated only for the account based in Italy.
Attached files: campi-ita.png
Hi again,
I looked into this - unfortunately it is a bit difficult technically to make our plugin support multiple VAT fields at the moment - many changes are needed to our code.
However, I worked on a code snippet to help you set the VAT field as only required for Italy.
To enable this:
1. In B2BKing -> Registration Fields -> enable only 1 VAT field. Make that field required. Select all countries that should have VAT (including Italy)
2. Add this PHP code snippet to your site:
The PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
thank you very much, I solved the VAT number field problem.
instead, for the Codice Univoco field, is there a way to link the display of the field based on the selected country without necessarily having it linked to a VAT number?
Do you mean to hide / show that field on the registration form, depending on which country is selected?
By default there is no feature for it, but I believe I can adjust the previous code snippet to make it do that. For that, just let me know what countries you'd like it to show for.
thanks, I need the Codice Univoco field which is mandatory and visible only for Italy.
To simplify, I make the VAT number field mandatory for all countries.
To set that up, please set the Codice Univoco field as a TEXT type field, and NOT REQUIRED.
Then add this code snippet to your site:
It should make it show only for Italy, as required. For other countries it would be hidden.
thankyou for all
it works if I select "none" in the WooCommerce Billing Field Connection field
but it only works in the registration form, in edit account it is always visible and not mandatory
Is that on the my account page -> account details tab?
There we do not have the country, so I don't think we have a way to make that work there. For that area, I can only suggest setting the field as "non-editable", so it can no longer be edited after the initial registration:
https://prnt.sc/IrBFp3kdAohu
As soon as the payment page opens, the Codice Univoco field is visible.
then the operation is correct: if I select Private Customer (B2C), the field disappears; while it appears when I select Business Customer (B2B).
Attached files: cu.png
Thank you for clarifying,
Please try changing the snippet to:
I made a change that I think can help.
It would also be important to make sure to clear all site caches. When I go to https://staging3.gioielloliquido.com/pagamento/ I do not see the field so I wonder whether this could be related to a caching problem. I'd suggest trying to see if it works for you with a new browser.
I use chrome-guest user and also firefox, clear caches, but the problem is always there.
Thank you for the details,
I tested this now as a logged out user but I cannot see the issue at the moment. I did not make any site changes.
This is what I am seeing:
https://www.loom.com/share/8fd55a1e05fd414c80aec97b1e251e4c?sid=be3463d5-338b-4aa0-9088-98c0644ae938
I started with a new browser (incognito) and added a product to cart then went to checkout.
Are you still seeing the problem? If so, do you know what I am doing different on my end? Thank you.
It's a mistery! I do the same things. The only difference is that I'm in Italy...
https://www.loom.com/share/f9be492971004c18a3a1411d26463189?sid=61c20ff1-4d64-4253-9cce-8b5852ea10b0
thanks for your patience :-)
You are right, that was the difference : )
I think I have solved it - I modified the snippet in the functions.php file.
Let me know if you still see an issue please,
BINGO! SOLVED!!!! :-)
Thankyou!!!! :-))))))