Code

WooCommerce Eu Vat Field

WooCommerce Eu Vat Field

The WooCommerce Eu Vat Field (WCEV) seamlessly integrates an additional EU Vat Number Field into your WooCommerce platform. It will be dinamically shown during the checkout process only if the selected billing country is part of the European Union. The plugin also offers several other options, like a way to validate the field, make it as a required one or to remove the VAT fee.

Note: The plugin, like WordPress, requires a minimum 5.5 PHP version.

LIVE DEMO

http://www.codecanyon.eu/wcev/wp-admin
(Shop admin account)
user: demo
pass: demo

(customer account)
user: demo2
pass: demo

THE IDEA

WCEV extends WooCommerce adding an EU Vat Number Field that will be dynamically shown during the checkout process and user profile page only if the selected billing country is part of the European Union. The Shop Admin can also make it compulsory and optionally validate it (the plugin uses the VIES function or simply check if it has a valid format ). It also allows you to not charge the users that enter a Vat number.

Configuration

By accessing to the WooCommerce -> EU Vat Field – Options you can configure the plugin options. You can, for example, disable the required option or show the Require invoice voice by which the customer can request an invoice. Furthermore, once enabled this option, you can also make the field visible only if the users requests an invoice.

Vat validation

The Vat number can be validated using the VIES function. In case the validation fails, the plugin will not allow the checkout to be completed and it will show a validation warning message (customizable using the Texts menu).

Validation can be also performed by just checking the if the Vat number has a valid format.

Don’t bother your users with unusefull checkout fields!

Why ask your customers for Company name and Vat if they are just consumers? WCEV allows you to not bother them! :)

Using the following options:
  1. Request an invoice: to display the Vat field only if the user requests an invoce.
  2. Consumer/Business selector to dynamically display the Company name and Vat fields only if the customer identify himself as a Business.

Tax exemption

The WCEV plugin will also allow you to not charge the VAT taxes for users that have inserted a VAT Number. Tax exemption can be applied to all users with a VAT Number (and optionally even for the ones who have the same billing country as the shop base location: WooCommerce -> Settings -> General -> Base Location).

Tax removal will take effect Shop, Product, Cart and Checkout pages. Once a valid VAT Number has been entered on Checkout or My account -> Billing addresses page, item prices and totals will showed and billed without taxes.

Business-to-Business made easy!

The shop admin can also make the Billing company name field as required! So optionally using this option in conjuction with the VIES Vat validation method and the enabling Tax removal option, shop admin can easily make business to business (b2b) sales.

Label and Text (WPML Localizable)

Field label, placeholder and validation error message can be customized using the Text menu. For WMPL users, text can be localized by just switching the current language using the WPML language selector and then entering texts for the current language.

Frontend integration

WCEV seamlessly integrates the EU Vat Field in the Checkout, My Account, Order details pages and in the Order emails. No configuration required!

Backend integration

WCEV seamlessly integrates the EU Vat Field also in the backend. The shop admin can retrieve Vat number information and if the user requested an invoice, from the Order details and Orders list pages:

Are you a WooCommerce PDF Invoices & Packing Slips user?

If you are using the WooCommerce PDF Invoices & Packing Slips plugin to generate invoices and you want to report the user VAT number associated to the order, simply modify the template you are using (usually is the templates/Simple/invoice.php) and use the following snippet of code:
global $wcev_order_model; 
$vat_number = $wcev_order_model->get_vat_number($order_id);
To retrieve the vat number. $order_id is the id of the order you want to retrieve the field

SCREENSHOTS


Frontend integration – Checkout
WCEV

Frontend integration – Billing details page (with the “request invoice” option enabled)
WCEV

Frontend integration – Order details page
WCEV

Email integration
WCEV

Backend integration – Order details page
WCEV

WCEV

Backend integration – Orders list page
WCEV

User profile page (Admin)
WCEV


CHANGE LOG


= 3.5 - 20.10.17 =
* Fixed an issue due to Company name was requested even it the customer type was selected

= 3.4 - 19.10.17 =
* Fixed an issue that may prevent the proper validation for Spain vat numbers

= 3.3 - 10.10.17 =
* Minor bugfix

= 3.2 - 06.10.17 =
* Added option to disable EU Vat field only for the selected EU Countries

= 3.1 - 14.09.17 =
* Fixed an issue that prevented to properly load the tax setting on WooCommerce -> Settings -> Tax tab

= 3.0 - 06.09.17 =
* Added option to show EU Vat field for any selected billing country

= 2.9 - 30.08.17 =
* On checkout page, when taxes are removed they are also removed from the cart subtotal usually showed on the top-right of the page
  (this requires that the theme properly implements the cart fragment)
* Fixed an issue that in some cases prevented Billing details to be saved when editing them using the My Account -> Billing address page

= 2.8 - 03.08.17 =
* Minor bugfix

= 2.7 - 22.07.17 =
* Fixed an issue due to "Business" option (within Business type selector) text was not customizable

= 2.6 - 16.06.17 =
* Added option to show Billing Company field (and make it mandatory) only when the "I need an invoice" option has been selected

= 2.5 - 02.06.17 =
* Fixed an issue that forced the user to enter the Vat number even if the field was hidden

= 2.4 - 26.05.17 =
* Minor bugfixes

= 2.3 - 12.05.17 =
* Improved Tax removal function

= 2.2 - 10.05.17 =
* Taxes are properly showed/hidden when switching from customer/business using the special selector
* Some UI improvements

= 2.1 - 06.05.17 =
* Fixed an issue with the new Business/Consumer selector feature

= 2.0 - 04.05.17 =
* Added option to display Company name and EU Vat field only if the user identify himself as business

= 1.9 - 22.04.17 =
* Improved tax exemption managment

= 1.8 - 10.04.17 =
* Fixed other WooCommerce 2.6 backward incopatibility issues

= 1.7 - 05/04/17 =
* Fixed an minor issue with WooCommerce 3.0

= 1.6 - 13/03/17 =
* Fixed a minor issue on a javascript library used in the Admin order edit page

= 1.5 - 08/03/17 =
* Vat number are now recognized even if the have the country code prefix
* Fixed an issue with Dynamic string translation (WPML)

= 1.4 - 05/03/17 =
* On manually loading billing user info on Order details page, now vat data is properly loded
* Added support for WooCommerce Multiple Addresses ( https://codecanyon.net/item/woocommerce-multiple-customer-addresses/16127030 )

= 1.3 - 23/02/17 =
* Added option to make Billing company field as required

= 1.2 - 22/02/17 =
* Added method to simply validate Vat number format

= 1.1 - 17/02/17 =
* Minor bugfix

= 1.0 - 15/02/17 =
* Release

by
by
by
by
by
by