EU/UK VAT Manager for WooCommerce: Shortcodes Guide
This guide categorizes and details the available shortcodes in the EU/UK VAT Manager for WooCommerce plugin, helping you to manage VAT validations, exemptions, and related functionalities on your WooCommerce store. Below is a comprehensive list of shortcodes available in both the free and pro versions of the plugin.
Free Version Shortcodes
- [alg_wc_eu_vat_translate]
- Description: Used to translate VAT-related messages into different languages, especially useful for WPML or Polylang setups.
- Parameters:
lang
: Language code (e.g.,en
for English,fr
for French).
- Example Usage:
[alg_wc_eu_vat_translate lang="en"] Your VAT number is valid.
- Use Case: Display VAT-related messages in the appropriate language based on the user’s preference.
- [alg_wc_eu_vat_validate]
- Description: Validates a VAT number using the VIES (VAT Information Exchange System) in real-time.
- Parameters:
vat_number
: The VAT number to validate.
- Example Usage:
[alg_wc_eu_vat_validate vat_number="DE123456789"]
- Use Case: Use this shortcode to validate VAT numbers entered by customers during the checkout process.
- [alg_wc_eu_vat_number]
- Description: Displays the customer’s VAT number that has been saved during the checkout process.
- Example Usage:
[alg_wc_eu_vat_number]
- Use Case: Display the VAT number in confirmation emails, invoices, or order summaries.
- [alg_wc_eu_vat_progress_message]
- Description: Shows customized progress messages during VAT number validation.
- Parameters:
- msg_valid: Message to show if the VAT number is valid.
- msg_invalid: Message to show if the VAT number is invalid.
- msg_validating: Message to display while the VAT number is being validated.
- Example Usage:
[alg_wc_eu_vat_progress_message msg_valid="Valid VAT!" msg_invalid="Invalid VAT." msg_validating="Checking VAT..."]
- Use Case: Improve the user experience during checkout by displaying real-time feedback as VAT numbers are being validated.
Pro Version Shortcodes
- [alg_wc_eu_vat_validate_advanced]
- Description: Performs advanced validation of VAT numbers, including matching company names and checking VAT number format.
- Parameters:
- vat_number: The VAT number to validate.
- company_name: Optional. Company name for additional validation.
- Example Usage:
[alg_wc_eu_vat_validate_advanced vat_number="GB123456789" company_name="Example Ltd."]
- Use Case: Use this shortcode for enhanced VAT validation where both the VAT number and company name must match.
- [alg_wc_eu_vat_exempt_message]
- Description: Displays a custom message if the customer’s VAT number is valid and they are exempt from VAT.
- Parameters:
- msg_exempt: Message to show when the VAT number is exempt.
- msg_not_exempt: Message to show when the VAT number is not exempt.
- Example Usage:
[alg_wc_eu_vat_exempt_message msg_exempt="You are VAT exempt." msg_not_exempt="VAT applies to your order."]
- Use Case: Display dynamic messages on the checkout page, reflecting whether the customer’s VAT exemption has been applied.
- [alg_wc_eu_vat_show_country_vat_rates]
- Description: Displays a table of VAT rates by country.
- Parameters:
- country: Optional. Filter by country code to show VAT rates for a specific country.
- Example Usage:
[alg_wc_eu_vat_show_country_vat_rates country="DE"]
- Use Case: Provide customers with transparent information about VAT rates applicable in different countries.
- [alg_wc_eu_vat_toggle_vat_field]
- Description: Allows customers to toggle the visibility of the VAT field on the checkout page.
- Parameters:
- show_text: Text to display for showing the VAT field.
- hide_text: Text to display for hiding the VAT field.
- Example Usage:
[alg_wc_eu_vat_toggle_vat_field show_text="Add VAT Number" hide_text="Remove VAT Number"]
- Use Case: Enhance the user interface by giving customers control over the visibility of the VAT field during checkout.
These shortcodes offer a powerful way to customize VAT-related functionalities in your WooCommerce store, ensuring compliance with EU/UK VAT regulations while enhancing the customer experience. The Pro version further extends the capabilities, offering advanced validation and additional customization options. Use these tools to seamlessly manage VAT and improve your store’s operational efficiency.