Merge branch 'master' of github.com:woothemes/woocommerce
This commit is contained in:
commit
466158a0b9
|
@ -250,10 +250,18 @@ class WC_Countries {
|
|||
* MC (monaco) and IM (isle of man, part of UK) also use VAT.
|
||||
*
|
||||
* @access public
|
||||
* @param $type Type of countries to retrieve. Blank for EU member countries. eu_vat for EU VAT countries.
|
||||
* @return string[]
|
||||
*/
|
||||
public function get_european_union_countries() {
|
||||
return array( 'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HU', 'HR', 'IE', 'IM', 'IT', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK' );
|
||||
public function get_european_union_countries( $type = '' ) {
|
||||
$countries = array( 'AT', 'BE', 'BG', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HU', 'HR', 'IE', 'IT', 'LT', 'LU', 'LV', 'MT', 'NL', 'PL', 'PT', 'RO', 'SE', 'SI', 'SK' );
|
||||
|
||||
if ( 'eu_vat' === $type ) {
|
||||
$countries[] = 'MC';
|
||||
$countries[] = 'IM';
|
||||
}
|
||||
|
||||
return $countries;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -292,7 +300,7 @@ class WC_Countries {
|
|||
* @return string
|
||||
*/
|
||||
public function tax_or_vat() {
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' );
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries( 'eu_vat' ) ) ) ? __( 'VAT', 'woocommerce' ) : __( 'Tax', 'woocommerce' );
|
||||
|
||||
return apply_filters( 'woocommerce_countries_tax_or_vat', $return );
|
||||
}
|
||||
|
@ -304,7 +312,7 @@ class WC_Countries {
|
|||
* @return string
|
||||
*/
|
||||
public function inc_tax_or_vat() {
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __( '(incl. VAT)', 'woocommerce' ) : __( '(incl. tax)', 'woocommerce' );
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries( 'eu_vat' ) ) ) ? __( '(incl. VAT)', 'woocommerce' ) : __( '(incl. tax)', 'woocommerce' );
|
||||
|
||||
return apply_filters( 'woocommerce_countries_inc_tax_or_vat', $return );
|
||||
}
|
||||
|
@ -316,7 +324,7 @@ class WC_Countries {
|
|||
* @return string
|
||||
*/
|
||||
public function ex_tax_or_vat() {
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries()) ) ? __( '(ex. VAT)', 'woocommerce' ) : __( '(ex. tax)', 'woocommerce' );
|
||||
$return = ( in_array($this->get_base_country(), $this->get_european_union_countries( 'eu_vat' ) ) ) ? __( '(ex. VAT)', 'woocommerce' ) : __( '(ex. tax)', 'woocommerce' );
|
||||
|
||||
return apply_filters( 'woocommerce_countries_ex_tax_or_vat', $return );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue