Skip to main content
Avalara Help Center

How do I resolve a customer code error in X-Cart?

Overview

You are seeing "Error CustomerCode is required. This value must be specified." in X-Cart and want to know how to resolve this so you can calculate tax.

Environment

X-Cart

Resolution

  • Update the X-Cart program to apply your company code to customers checking out as guests:
    • In modules/AvaTax/func.php

      • In function func_avatax_get_taxes, add line with 'email': 
        'id' => 1, 
        'email' => 1, 
        )); 

      • In function func_avatax_get_taxes_internal

        • change line:    $request->setCustomerCode(!empty($customerInfo['id']) ? $customerInfo['id'] : ''); 

        • to:     $request->setCustomerCode(!empty($customerInfo['id']) ? $customerInfo['email'] : ''); 

  • For additional assistance with this issue please contact X-Cart support support@x-cart.com

 

 

 

 

  • Was this article helpful?