PHP code example of sitewards / tax

1. Go to this page and download the library: Download sitewards/tax 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/ */

    

sitewards / tax example snippets


$taxCalculationRates = [
    [
        'region_id' => 0,
        'postcode' => '*',
        'label' => 'IVA 22%',
        'rate' => 22
    ],
    [
        'region_id' => 0,
        'postcode' => '*',
        'label' => 'IVA 10%',
        'rate' => 10
    ],
    [
        'region_id' => 0,
        'postcode' => '*',
        'label' => 'IVA 4%',
        'rate' => 4
    ],
    [
        'region_id' => 0,
        'postcode' => '*',
        'label' => 'IVA 0%',
        'rate' => 0
    ],
];

$euCountries = explode(',', Mage::getStoreConfig('general/country/eu_countries'));
$installer->addTaxCalculationRates($euCountries, $taxCalculationRates);