• Resolved andreu

    (@andreu)


    Hi,

    My client asks the plugin to avoid adding the country prefix on the VAT number. For example if we put B1234533 it automatically transform into an ESB1234533 and a NIE Y123456X it is transformed into an ESY123456X.

    Can we avoid that at least when the VAT number is from the same country than the shop?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Diego

    (@daigo75)

    Hi Andreu,
    What you describe will require some custom code. If you’re looking to remove the prefix from the VAT number stored against the order, that value is saved in the post meta, as well as the user meta table, with meta key vat_number. The value is stored in event woocommerce_checkout_update_order_meta for orders, and woocommerce_checkout_update_user_meta for users.

    We don’t have an example of how to remove the country prefix, as that’s not something that we planned to do. In your custom code, you could either remove the prefix from the meta stored in the database, or leave the stored data intact and remove the prefix after you load it from the database.

    If you choose to remove the prefix from the database, we would recommend to test the site thoroughly, as you would be altering data that the EU VAT Assistant might expect to be in a specific format (i.e. with the prefix). This scenario, as well as the custom code to handle it, has not been tested, and it’s not officially supported.

Viewing 1 replies (of 1 total)
  • The topic ‘Avoid country addition in VAT ID’ is closed to new replies.