Create a custom tax picker

The ITaxPicker interface allows you to apply custom logic when the Ecommerce module chooses which tax is going to be applied. To do this, you must perform the following:

  1. Create a class for your custom tax picker.
    Create a class that will represent the tax picker. In this example the name CustomTaxPicker is used.
  2. Implement the ITaxPicker interface.
    The interface requires the FindTax method to be implemented
  3. Implement the FindTax method.
    In this method you can apply custom logic when selecting the tax that is going to be applied. As arguments you receive the shipping address of the cart. If there is no shipping address defined, you the argument will be the billing address.
    Use the following code sample:
  4. Register the custom tax picker.
    In the Global.asax file, register the custom tax picker in the following way:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?