| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
Avalara AvaTax Module Error Fix | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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! |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Avalara AvaTax Module Error Fix
you should report this in the bug tracker
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
Re: Avalara AvaTax Module Error Fix
Okay. I reported it. I also edited the last line of code in my original post.
|
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|