Manual

Die Datei für Konfiguration anlegen

Format Datei

Beispiel einer tax-rates Datei:

tax_country_id;tax_region_id;tax_postcode;code;rate;zip_is_range;zip_from;zip_to;store_de;store_en
AT;0;*;AT 20%;20.0;;;;inkl. MwSt;including VAT
DE;0;*;DE 19%;19.0;;;;inkl. MwSt;including VAT

Beispiel einer tax-rules Datei:

code;priority;position;calculate_subtotal;rate_codes;customer_tax_classes;product_tax_classes
Standard VAT Rule;0;0;0;AT 20%,DE 19%;Retail Customer;Standard Rate

Die Datei aufrufen

# Create new product tax classes in your setup script
$taxClassId = $this->taxConfigurator->createProductTaxClass('Standard Rate');

# Maintain tax rates and tax rules in CSV files (see example for [tax rates](doc/tax-rates.csv) and [tax rules](doc/tax-rules.csv))
# Update tax rates and rules in your setup script
$this->taxConfigurator->createTaxRatesFromFile('path/to/tax-rates.csv');
$this->taxConfigurator->createTaxRulesFromFile('path/to/tax-rules.csv');

for Magneto 2.3.x: Do not use startSetup() and endSetup() around the functions as it disables the foreign keys check and the old rates can not be fully deleted https://community.magento.com/t5/Magento-DevBlog/Mysterious-startSetup-and-endSetup-Methods/ba-p/68483