Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
How do I exclude a country so that the VAT number field on the checkout page only shows for certain countries?
How do I exclude a country so that the VAT number field on the checkout page only shows for certain countries?
Comments
Comment #1
dwkitchen CreditAttribution: dwkitchen commentedYou can use rules to control the display of a checkout pane with http://drupal.org/project/commerce_rules_extra
Comment #2
Egan7 CreditAttribution: Egan7 commentedComment #3
dwkitchen CreditAttribution: dwkitchen commentedHi,
Please explain why you have changed the status back and set to active?
The does depend on how you are using the VAT Number field. If you are adding it to the existing billing or shipping customer profiles you could try the Conditional Fields module. However I would recommend creating a new customer profile type just for the VAT number (and possibly and other business information).
You can control the display of the Tax Customer Profile using the above mentioned module.
You will also need to check that the country of the VAT number provided matches that of the shipping destination.
Comment #4
dwkitchen CreditAttribution: dwkitchen commentedThis code might also help.
Comment #5
Egan7 CreditAttribution: Egan7 commentedHi dwkitchen,
Sorry it has been so long. Firstly my page was cached when I changed the setting on this query, then your comment came up. since then I have had to work on other areas, then I got the flu so its been a while.
I have tried all above methods except for the code. Basically we are planning to sell electronic goods so there is no supplier nor shipping methods. The rules on VAT are thus different. What we want is for EU countries to pay VAT (unless they have a VAT number). The exception to this rule is the UK where they pay VAT despite having a number.
Thus rather than adding to the code to negate a country, surely it would be easier to manipulate the code that lists the 'EU' countries and comment out the UK (GB) as if the UK was not an EU country. I tried this in the .module file but the VAT field still appears. when UK is selected as the country in the Billing information. What is causing that to appear?
Perhaps the code above works but there is an undefined function in it: _commerce_eu_vat_eu_countries()
Perhaps this function denotes the EU countries and manipulating that would work?
Thanks
Comment #6
dwkitchen CreditAttribution: dwkitchen commentedConsider using the Commerce EU VAT module for a quick EU VAT setup that covers digital products.