VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: nickwiebe on August 15, 2014, 23:03:23 PM

Title: CustomerCode Error when Submitting order
Post by: nickwiebe on August 15, 2014, 23:03:23 PM
A customer is trying to submit an order and they are getting this error

AvaTax Error CustomerCode length must be between 1 and 50 characters.

I use AvaTax for tax calculations and when VirtueMart sends an order through AvaTax it automatically creates a customer code based on this formula if the customer chooses not to register:

nonreg_firstnameLastnameEmail@email.com

Is there a way to change the settings in VirtueMart so it doesn't use the first name, last name and email address for this customer code but rather just the email address?  If I can't do it in the settings, can you tell me what file and where in the code to change this?  AvaTax only allows up to 50 characters for the CustomerCode.

HELP PLEASE
Title: Re: CustomerCode Error when Submitting order
Post by: GJC Web Design on August 16, 2014, 20:48:07 PM
had exactly the same problem with my http://forum.virtuemart.net/index.php?topic=113564.msg381938#msg381938

the string is core VM so I just shortened it in the taxcloud plugin

e.g.  $customernumber = substr($cart->customer_number,0,32); //shorten cust id to 32 for guest checkout

so for Alva I assume around line 466 in alavara.php

$vmadd['customer_number'] = substr($cart->customer_number,0,50);

make sure the plug doesn't recheck this on the return
Title: Re: CustomerCode Error when Submitting order
Post by: OrangeYouGlad? on October 28, 2014, 22:10:10 PM
Thanks for the assist @GJC Web Design


Nickwiebe are you still experiencing this error?