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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?