Download the PHP package sehrgut/wp-eu-vat-helpers without Composer
On this page you can find all versions of the php package sehrgut/wp-eu-vat-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sehrgut/wp-eu-vat-helpers
More information about sehrgut/wp-eu-vat-helpers
Files in sehrgut/wp-eu-vat-helpers
Package wp-eu-vat-helpers
Short Description WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)
License MIT
Informations about the package wp-eu-vat-helpers
WordPress EU VAT Helpers
WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)
This WordPress plugin is basically a wrapper around the nifty mpociot/vat-calculator library. Use at your own risk for the following:
- Format number as localized currency, adding VAT according to the rate of the visitor's country
- Display tax rate of the visitor's coutry
- Display the visitor's country
- Conditionally show/hide elements based on whether EU VAT is applicable in the visitor's country
Installation
- Recommended (most frequent updates):
composer require sehrgut/wp-eu-vat-helpers - Alternative (possibly outdated): Via WordPress plugin directory or zip download, you know that stuff for sure…
Available Shortcodes
[localize_currency][vat_rate][ip_country][if_taxable] … [/if_taxable][unless_taxable] … [/unless_taxable]
Shortcode Usage
[localize_currency]
Add EU VAT to value and format the result as currency.
Example:
Attributes:
| Attribute | Required | Default | Effect |
|---|---|---|---|
value |
required | – | The amount to format |
currency |
optional | 'EUR' | Currency as three-letter ISO-4217 code |
country |
optional | based on user's IP address | Override the country for which to apply taxes and adapt the format (two-letter ISO-3166-1 alpha-2 code) |
[vat_rate]
Display the EU VAT rate applicabe in the current user's country in percent.
Example:
Attributes:
| Attribute | Required | Default | Effect |
|---|---|---|---|
country |
optional | based on user's IP address | Override the country whose VAT rate to display (two-letter ISO-3166-1 alpha-2 code) |
[ip_country]
Display the current user's country based on their IP address.
Example:
Attributes: none
[if_taxable]
Condtitionally display a piece of content if EU VAT is applicable in the current user's country.
Example:
Attributes:
| Attribute | Required | Default | Effect |
|---|---|---|---|
country |
optional | based on user's IP address | Override the country for which to check (two-letter ISO-3166-1 alpha-2 code) |
[unless_taxable]
Condtitionally display a piece of content if EU VAT is not applicable in the current user's country. (Inverse of
if_taxable)
Example:
| Attributes: | Attribute | Required | Default | Effect |
|---|---|---|---|---|
country |
optional | based on user's IP address | Override the country for which to check (two-letter ISO-3166-1 alpha-2 code) |
Devlopment / Testing
Support
Please use Github Issues for Questions, Bug reports, Feature suggestions and everything else.
Compatibility
This plugin was tested with WordPress 4.8.x and PHP 7.1 & 7.2
License
Copyright 2017 Sehr gute GmbH – licensed under the MIT License.