EU/UK VAT Compliance Assistant for WooCommerce Shortcode

Below, you’ll find a detailed guide on how to add the EU/UK VAT Compliance Assistant for WooCommerce Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the EU/UK VAT Compliance Assistant for WooCommerce Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the EU/UK VAT Compliance Assistant for WooCommerce Plugin and the shortcodes it provides:

Plugin Icon
EU/UK VAT Compliance Assistant for WooCommerce

"EU/UK VAT Compliance Assistant for WooCommerce is a robust plugin designed to handle VAT issues for your online store. It simplifies tax management and ensures your WooCommerce store is fully compliant with EU/UK VAT regulations."

★★★★☆ (24) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [euvat_country_selector]

EU/UK VAT Compliance Assistant for WooCommerce [euvat_country_selector] Shortcode

The Woocommerce EU VAT Compliance plugin shortcode, ‘euvat_country_selector’, is designed to render a dropdown menu. This shortcode allows users to select a country for VAT purposes. It includes an option to include or exclude countries with no taxes. It also allows customization of the dropdown’s CSS classes.

Shortcode: [euvat_country_selector]

Parameters

Here is a list of all possible euvat_country_selector shortcode parameters and attributes:

  • include_notaxes – Determines if countries with no taxes are included.
  • classes – Optional CSS classes to style the country selector.
  • include_which_countries – Defines which countries to include in the dropdown.

Examples and Usage

Basic example – Display a VAT country selector with default parameters.

[euvat_country_selector]

Advanced examples

Display a VAT country selector with specific classes for custom styling.

[euvat_country_selector classes="custom-class1 custom-class2"]

Display a VAT country selector excluding countries where no taxes are applied.

[euvat_country_selector include_notaxes=0]

Display a VAT country selector including only EU countries.

[euvat_country_selector include_which_countries="EU"]

Display a VAT country selector with specific classes and only including EU countries.

[euvat_country_selector classes="custom-class1 custom-class2" include_which_countries="EU"]

PHP Function Code

In case you have difficulties debugging what causing issues with [euvat_country_selector] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('euvat_country_selector', array($this, 'shortcode_vat_country_selector'));

Shortcode PHP function:

function shortcode_vat_country_selector($atts) {
		$atts = shortcode_atts(array(
			'include_notaxes' => 1,
			'classes' => '',
			'include_which_countries' => 'all'
		), $atts, 'euvat_country_selector');

		ob_start();
		$this->render_dropdown($atts['include_notaxes'], $atts['classes'], $atts['include_which_countries']);
		return ob_get_clean();
	}

Code file location:

woocommerce-eu-vat-compliance/woocommerce-eu-vat-compliance/preselect-country.php

Conclusion

Now that you’ve learned how to embed the EU/UK VAT Compliance Assistant for WooCommerce Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *