1. Go to this page and download the library: Download jakubjachym/vat-calculator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jakubjachym / vat-calculator example snippets
// Easy to use!
use JakubJachym\VatCalculator\VatCalculator;
$vatRates = new VatRates();
$vatCalculator = new VatCalculator($vatRates);
$vatCalculator->calculate(71.00, 'DE' /* $countryCode */, '41352' /* $postalCode or null */, true /* Whether the customer you're calculating the VAT for is a company */);
$vatCalculator->getTaxRateForLocation('NL');
// Check validity of a VAT number
$vatCalculator->isValidVatNumber('NL123456789B01');
use JakubJachym\VatCalculator\VatCalculator;
$vatRates = new VatRates();
$vatCalculator = new VatCalculator($vatRates);
$vatCalculator->setBusinessCountryCode('DE'); // Where your company is based in
$price = $vatCalculator->calculate(49.99, 'LU', null, false);
$price->getPrice();
$price->getNetPrice();
$price->getTaxValue();
$price->getTaxRate();