Custom Tax Provider
Posted: Thu May 16, 2013 9:36 am
Using AbleCommerce GOLD build 5410.
I am trying create a custom tax provider. I have followed the Wiki article here:http://wiki.ablecommerce.com/index.php/ ... x_Provider
I wanted to start with something simple to prove that I could make it work, so for now, my Calculate method simply sums the NetExtendedPrice for each basket item and returns 7% of that. It also uses CommerceBuilder.Utility.Logger.Debug() to log the return value. However, no tax is showing up on the order and no message is showing up in the log. The ConfigData field in the ac_TaxGateways table has "Enabled=True". I am not getting any erros. So I have a few questions:
1. The Wiki page talks about "adding line items to the basket for each line item". Also, the existing line items already have tax fields. If I only want to calculate the tax on the total, do I need to add line items and/or fill in the tax field on the existing line items, or can I just return the total tax?
2. Do I need to have a Tax Code and/or Tax Rule defined? If so, how do I indicate that it/they should use my tax provider?
3. Am I using CommerceBuilder.Utility.Logger.Debug() correctly - i.e. does it create a message that shows up on the Help > Error Log page?
4. Are there other things I need in the "ConfigData" field of the ac_TaxGateways table?
Any other suggestions / help anyone could provide on creating a custom tax provider would be appreciated. Thanks.
I am trying create a custom tax provider. I have followed the Wiki article here:http://wiki.ablecommerce.com/index.php/ ... x_Provider
I wanted to start with something simple to prove that I could make it work, so for now, my Calculate method simply sums the NetExtendedPrice for each basket item and returns 7% of that. It also uses CommerceBuilder.Utility.Logger.Debug() to log the return value. However, no tax is showing up on the order and no message is showing up in the log. The ConfigData field in the ac_TaxGateways table has "Enabled=True". I am not getting any erros. So I have a few questions:
1. The Wiki page talks about "adding line items to the basket for each line item". Also, the existing line items already have tax fields. If I only want to calculate the tax on the total, do I need to add line items and/or fill in the tax field on the existing line items, or can I just return the total tax?
2. Do I need to have a Tax Code and/or Tax Rule defined? If so, how do I indicate that it/they should use my tax provider?
3. Am I using CommerceBuilder.Utility.Logger.Debug() correctly - i.e. does it create a message that shows up on the Help > Error Log page?
4. Are there other things I need in the "ConfigData" field of the ac_TaxGateways table?
Any other suggestions / help anyone could provide on creating a custom tax provider would be appreciated. Thanks.