Registering New Tax Provider
In order to calculate taxes in Virto Commerce, you've got to register at least one
Defining New Tax Provider¶
In order to define a new tax provider, you need to:
- Create a new module by following this guide
- Create a class derived from the
TaxProviderabstract class and override the
- Register your module class in the DI container. This must be done in the
PostInitializemethod. You can also associate the settings, which will be used in your method and can be changed in the management UI.
public void PostInitialize(IApplicationBuilder applicationBuilder)
var settingsRegistrar = applicationBuilder.ApplicationServices.GetRequiredService<ISettingsRegistrar>();
var taxProviderRegistrar = applicationBuilder.ApplicationServices.GetRequiredService<ITaxProviderRegistrar>();
//Associate the settings with the particular tax provider
All settings may have default values that can be used for default methods if not overridden by custom values later.
To view or download our sample code, click here.
Enabling and Configure Tax Provider for Store¶
After your module is installed in your target system, all tax providers should appear and be available for configuration in every store in your system under the
Store->Tax providers widget. You can configure tax provider for each store individually:
- Enable or disable a provider for the current store
- Edit all settings and what you define for the tax calculation provider
- Use a custom UI for a more detailed tax provider configuration
After you complete the configuration, your tax provider will be used for tax calculation of orders in the store.
If our standard user interface is not enough, you may consider implementing your own UI for managing tax providers through the standard UI extension point (widget container with the
taxProviderDetail group). You can read more about extending the existing UI with widgets here.