2017 © Pedro Peláez
 

wordpress-plugin wp-eu-vat-helpers

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

image

sehrgut/wp-eu-vat-helpers

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  • Tuesday, November 14, 2017
  • by jsphpl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

WordPress EU VAT Helpers

WordPress Packagist Travis Build Status Codecov StyleCI Status, (*1)

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address), (*2)

This WordPress plugin is basically a wrapper around the nifty mpociot/vat-calculator library. Use at your own risk for the following:, (*3)

  • 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

  1. Recommended (most frequent updates): composer require sehrgut/wp-eu-vat-helpers
  2. Alternative (possibly outdated): Via WordPress plugin directory or zip download, you know that stuff for sure…

Available Shortcodes

Shortcode Usage


[localize_currency]

Add EU VAT to value and format the result as currency., (*4)

Example:, (*5)

[localize_currency value="133.42" currency="EUR"]

Attributes:, (*6)

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., (*7)

Example:, (*8)

[vat_rate]

Attributes:, (*9)

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., (*10)

Example:, (*11)

[ip_country]

Attributes: none, (*12)


[if_taxable]

Condtitionally display a piece of content if EU VAT is applicable in the current user's country., (*13)

Example:, (*14)

[if_taxable]Echo something[/if_taxable]

Attributes:, (*15)

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), (*16)

Example:, (*17)

[unless_taxable]Echo something[/unless_taxable]

Attributes: , (*18)

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

# Install
git clone git@github.com/sehrgutesoftware/wp-eu-vat-helpers.git
cd wp-eu-vat-helpers
composer install

# Test
composer unit
composer integration

Support

Please use Github Issues for Questions, Bug reports, Feature suggestions and everything else., (*19)

Compatibility

This plugin was tested with WordPress 4.8.x and PHP 7.1 & 7.2, (*20)

License

Copyright 2017 Sehr gute GmbH – licensed under the MIT License., (*21)

The Versions

14/11 2017

dev-master

9999999-dev

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joseph Paul

13/11 2017

1.1.2

1.1.2.0

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joseph Paul

29/08 2017

v1.1.1

1.1.1.0

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joseph Paul

29/08 2017

v1.1.0

1.1.0.0

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joseph Paul

29/08 2017

v1.0.0

1.0.0.0

WordPress helper shortcodes to display prices including applicable VAT rate for the user's location (based on IP address)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joseph Paul