![]() |
Avalara AvaTax Module Error Fix
I created an account with Avalara and activated the module in X-Cart 4.6.5. When I tried to get a tax calculation in the cart, nothing showed up. The log showed this error:
RequiredError: CustomerCode is required. I poked around in this file: modules/AvaTax/func.php Each transaction submitted to Avalara must have a unique Customer Code attached to it. The default programming for the routine uses X-Cart's Customer ID, which does not exist for unregistered customers. So I modified the code to use the customer's email address instead. In function func_avatax_get_taxes, I added the line with 'email': 'id' => 1, 'email' => 1, )); In function func_avatax_get_taxes_internal I changed this line: $request->setCustomerCode(!empty($customerInfo['id']) ? $customerInfo['id'] : ''); to this: $request->setCustomerCode(!empty($customerInfo['email']) ? $customerInfo['email'] : ''); It's working for me, but do your own testing! |
Re: Avalara AvaTax Module Error Fix
you should report this in the bug tracker
|
Re: Avalara AvaTax Module Error Fix
Okay. I reported it. I also edited the last line of code in my original post.
|
All times are GMT -8. The time now is 09:34 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.