Thread: TaxCloud Addon

Page 12 of 16 FirstFirst ... 21011121314 ... LastLast
Results 111 to 120 of 159
  1. #111
    Join Date
    Oct 2016
    Location
    Mississippi
    Posts
    8
    Plugin Contributions
    1

    Default Re: TaxCloud Addon

    We are being charged for redundant lookups as well. Is there a way to log the lookups?

  2. #112
    Join Date
    Apr 2012
    Location
    Los Angeles, CA
    Posts
    185
    Plugin Contributions
    2

    Default Re: TaxCloud Addon

    Quote Originally Posted by LarryLMiller View Post
    We are being charged for redundant lookups as well. Is there a way to log the lookups?
    You need to call taxcloud: If you are signed up for automated compliance, you should not be, being charged. 1-877-TAXCLOUD keep calling til you get someone.

  3. #113
    Join Date
    Apr 2012
    Location
    Los Angeles, CA
    Posts
    185
    Plugin Contributions
    2

    help question ZC 1.5.6 and Taxcloud 16b

    Ok so after the upgrade to 1.5.6 I was comparing my the Developer's Tool Kit logs between my live site and the test site and realized that there were entire parts of the module missing. So after backing up everything in the test site, I removed and reinstalled the Taxcloud 16b module. The store side works well but I am getting an issue in the admin area, I am looking at the log and I know there is something I am not understanding?

    The log shows:
    Code:
     
     myDEBUG-adm-1545852159-733497.log ( ASCII text ) 
    [26-Dec-2018 14:22:40 America/Detroit] Request URI: /webstore2/zcadmin/orders.php?oID=144&origin=index, IP address: 23.243.5.141
    #1  require_once() called at [/home/sammirah/public_html/webstore2/includes/classes/order.php:34]
    #2  include(/home/sammirah/public_html/webstore2/includes/classes/order.php) called at [/home/sammirah/public_html/webstore2/zcadmin/orders.php:32]
    [26-Dec-2018 14:22:40 America/Detroit] PHP Warning:  require_once(includes/modules/TaxCloud/func.taxcloud.php): failed to open stream: No such file or directory in /home/sammirah/public_html/webstore2/includes/classes/order.php on line 34
    [26-Dec-2018 14:22:40 America/Detroit] PHP Fatal error:  require_once(): Failed opening required 'includes/modules/TaxCloud/func.taxcloud.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/php56/lib/php') in /home/sammirah/public_html/webstore2/includes/classes/order.php on line 34
    The file includes/classes/order.php on line 34 simply says:

    Code:
    require_once DIR_WS_MODULES . 'TaxCloud/func.taxcloud.php';
    I think this means there is a missing phrase that makes the module do something but I have no idea how to write it to make it do what it is supposed to do, I appreciate any help with this please.

  4. #114
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: ZC 1.5.6 and Taxcloud 16b

    it is complaining about a file not being there OR the file could have the incorrect ownership/permissions.

    is the file:

    /home/sammirah/public_html/webstore2/includes/modules/TaxCloud/func.taxcloud.php

    there? and is the ownership and permissions similar to the other files in that directory?
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #115
    Join Date
    Apr 2012
    Location
    Los Angeles, CA
    Posts
    185
    Plugin Contributions
    2

    help question Re: ZC 1.5.6 and Taxcloud 16b

    Quote Originally Posted by carlwhat View Post
    it is complaining about a file not being there OR the file could have the incorrect ownership/permissions.

    is the file:

    /home/sammirah/public_html/webstore2/includes/modules/TaxCloud/func.taxcloud.php

    there? and is the ownership and permissions similar to the other files in that directory?
    Yes the file is there
    PHP Code:
    <?php
    /**
     * TaxCloud v1.5
     * @license https://taxcloud.net/ftpsl.pdf
     */
    require("classes.php");

    define('TAXCLOUD_VERSION''v1.5');

    define('FILENAME_TAXCLOUD''taxcloud');
    define('BOX_TAXES_TAXCLOUD''TaxCloud Tax Calculation');

    function 
    func_taxcloud_get_client() {
        if ( isset(
    $client) ) {
            return 
    $client;
        } else {
            
    $client = new SoapClient("https://api.taxcloud.net/1.0/TaxCloud.asmx?wsdl");
            return 
    $client;
        }
    }

    function 
    func_taxcloud_is_enabled($country_code='') {    

        if (
    $country_code != '223') {
            return 
    false;
        }
          
    $configuration_query "select c.configuration_value from " TABLE_CONFIGURATION " c, " TABLE_CONFIGURATION_GROUP " cg where cg.configuration_group_title = 'TaxCloud Configuration Settings' and c.configuration_key = 'TAXCLOUD_ENABLED' and c.configuration_group_id = cg.configuration_group_id";
         global 
    $db;    
          
    $results $db->Execute($configuration_query);
          
    $isEnabled $results->fields['configuration_value'];    
        return 
    $isEnabled;
    }


    /**
     * Verify an address using TaxCloud service
     */
    function func_taxcloud_verify_address($address, &$err) {

        global 
    $client;
        

        
    // Verify the address through the TaxCloud verify address service
        
    $params = array( "uspsUserID" => TAXCLOUD_USPS_ID,
                     
    "address1" => $address->getAddress1(),
                     
    "address2" => $address->getAddress2(),
                     
    "city" => $address->getCity(),
                     
    "state" => $address->getState(),
                     
    "zip5" => $address->getZip5(),
                     
    "zip4" => $address->getZip4());

        try {
            
    $client func_taxcloud_get_client();
            
    $verifyaddressresponse $client->verifyAddress$params );

        } catch (
    Exception $e) {

            
    //retry in case of timeout
            
    try {
                
    $verifyaddressresponse $client->verifyAddress$params );
            } catch (
    Exception $e) {

        
    //        $err[] = "Error encountered while verifying address ".$address->getAddress1().
        //        " ".$address->getState()." ".$address->getCity()." "." ".$address->getZip5().
        //        " ".$e->getMessage();
        //        //irreparable, return
                
    return null;
            }
        }

        if(
    $verifyaddressresponse->{'VerifyAddressResult'}->ErrNumber == 0) {
            
    // Use the verified address values
            
    $address->setAddress1($verifyaddressresponse->{'VerifyAddressResult'}->Address1);
            
    $address->setAddress2($verifyaddressresponse->{'VerifyAddressResult'}->Address2);
            
    $address->setCity($verifyaddressresponse->{'VerifyAddressResult'}->City);
            
    $address->setState($verifyaddressresponse->{'VerifyAddressResult'}->State);
            
    $address->setZip5($verifyaddressresponse->{'VerifyAddressResult'}->Zip5);
            
    $address->setZip4($verifyaddressresponse->{'VerifyAddressResult'}->Zip4);

        } else {

        
    //    $err[] = "Error encountered while verifying address ".$address->getAddress1().
        //        " ".$address->getState()." ".$address->getCity()." "." ".$address->getZip5().
        //        " ".$verifyaddressresponse->{'VerifyAddressResult'}->ErrDescription;

            
    return null;
        }
        return 
    $address;
    }

    function 
    func_taxcloud_get_customer_address($delivery) {    
        
    // Customer's address
        
    $destination = new Address();    
        
    $destination->setAddress1($delivery['street_address']);
        
    $destination->setAddress2('');
        
    $destination->setCity($delivery['city']);
        
    $destination->setState($delivery['state']); // Two character state appreviation
        
    $destination->setZip5($delivery['postcode']);
        
    $destination->setZip4('');
        return 
    $destination;
    }

    /**
     * Get the store's location
     */
    function func_taxcloud_get_company_address() {    
        
    $origin = new Address();
        
    $origin->setAddress1(TAXCLOUD_STORE_ADDR);
        
    $origin->setZip5(TAXCLOUD_STORE_ZIP);     
        return 
    $origin;
    }

    /**
     * Retrieves a product's TIC ID.
     * @param $product_id
     */
    function func_taxcloud_get_tic($product_id) {
        global 
    $db;    
        
    $query "select tax_class_title from ".TABLE_PRODUCTS .", ".TABLE_TAX_CLASS." where products_tax_class_id = tax_class_id and products_id = ".$product_id;    
        
    $result $db->Execute($query);                        
        
    $tic $result->fields['tax_class_title'];        
        
    $i preg_match("/^(\d+)/"$tic);
        if(
    $i != 0)
            return 
    $tic;
        else 
            return 
    $i;            
    }

    /**
     * Look up tax cost using TaxCloud web services
     * @param $product
     * @param $customer
     */
    function func_taxcloud_lookup_tax($products,$customerAddress,&$errMsg,$shipping$exemptionCertificate) {
        global 
    $client

        
    $origin func_taxcloud_get_company_address();    
        
    $origin func_taxcloud_verify_address($origin$errMsg);
        
        if(
    is_null($origin)) return -1;    
        
        
    //Verify Customer's destination
        
    $destination func_taxcloud_get_customer_address($customerAddress);    
        
    $verified_destination func_taxcloud_verify_address($destination$errMsg);
        
        if(!
    is_null($verified_destination)) {
            
    $destination $verified_destination;
        }
        
        if(!
    is_null($origin) && !is_null($destination)) {
        
            
    $cartItems = Array();

            
    $index 0;
            
            foreach (
    $products as $k => $product) {

                
    $cartItem = new CartItem();
                            
                
    preg_match("/^(\d+)/"$product['id'], $match);            

                
    $cartItem->setItemID($match[0]);
                
    $cartItem->setIndex($index); // Each cart item must have a unique index

                
    $tic func_taxcloud_get_tic($match[0]);
                if(!
    $tic) {
                    
    //no TIC has been assigned to this product, use default
                    
    $tic null;
                }
                
                
    $cartItem->setTIC($tic);
                
                
    $price $product['final_price'];
                
                
    $cartItem->setPrice($price); // Price of each item
                
    $cartItem->setQty($product['qty']); // Quantity   

                
    $cartItems[$index] = $cartItem;

                
    $index++;

            }

            
    //Shipping as a cart item
            
    $cartItem = new CartItem();
            
    $cartItem->setItemID('shipping');
            
    $cartItem->setIndex($index);
            
    $cartItem->setTIC(11010);
            
    $cartItem->setPrice($shipping);
            
    $cartItem->setQty(1);
            
    $cartItems[$index] = $cartItem;    
        
            
    $params = array( "apiLoginID" => TAXCLOUD_API_ID,
                     
    "apiKey" => TAXCLOUD_API_KEY,
                     
    "customerID" => $_SESSION['customer_id'],
                     
    "cartID" => $_SESSION['cartID'],
                     
    "cartItems" => $cartItems,
                     
    "origin" => $origin,
                     
    "destination" => $destination,
                     
    "deliveredBySeller" => false,
                     
    "exemptCert" => $exemptionCertificate
            
    );
            
            
    $client func_taxcloud_get_client();

            try {
                
    $lookupResponse $client->lookup$params );
            } catch (
    Exception $e) {
                
    //retry
                
    try {
                    
    $lookupResponse $client->lookup$params );
                } catch (
    Exception $e) {

                    
    $errMsg[] = "Error encountered looking up tax amount ".$e->getMessage();
        
                    
    //irreparable, return
                    
    return -1;
                }
            }

            
    $lookupResult $lookupResponse->{'LookupResult'};

            if(
    $lookupResult->ResponseType == 'OK' || $lookupResult->ResponseType == 'Informational') {
                
    $cartItemsResponse $lookupResult->{'CartItemsResponse'};
                
    $cartItemResponse $cartItemsResponse->{'CartItemResponse'};
                
    $taxes = Array();
                
    $index 0;

                
    //response may be an array
                
    if ( is_array($cartItemResponse) ) {
                    foreach (
    $cartItemResponse as $c) {
                        
    $amount = ($c->TaxAmount);
                        
    $taxes[$index] = $amount;
                        
    $index++;
                    }
                } else {
                    
    $amount = ($cartItemResponse->TaxAmount);
                    
    $taxes[0] = $amount;
                }
                
                
    $cartID $lookupResult->CartID;
                if ( isset(
    $cartID) ) {
                    
    $_SESSION['cartID'] = $cartID;
                }
                
                
    $taxTotal 0;
                
    //Calculate tax totals
                
    foreach( $taxes as $tax ) {
                    
    $taxTotal $taxTotal round($tax,2);
                }
                
                
    $_SESSION['taxcloudTaxTotal'] =  $taxTotal;
                return array(
    'name' => 'Sales Tax''tax' => $taxTotal);
                
            } else {
                
    $errMsgs $lookupResult->{'Messages'};
                foreach(
    $errMsgs as $err) {
                    
    $errMsg[] = "Error encountered looking up tax amount ".$err->{'Message'};                
                }
                return -
    1;
            }
        } else {

            return -
    1;
        }
    }

    /**
     * Authorized with Capture 
     * @param $orderID
     */
    function func_taxcloud_authorized_with_capture($orderID, &$errMsg) {
        global 
    $client;

        
    $result 0;
        
        
    $dup "This purchase has already been marked as authorized";
        
        
    // Current date - example of format: '2010-09-08T00:00:00';
        
    $dateAuthorized date("Y-m-d");
        
    $dateAuthorized $dateAuthorized "T00:00:00";    

        
    $params = array( "apiLoginID" => TAXCLOUD_API_ID,
                         
    "apiKey" => TAXCLOUD_API_KEY,
                         
    "customerID" => $_SESSION['customer_id'],
                         
    "cartID" => $_SESSION['cartID'],
                         
    "orderID" => $orderID,
                         
    "dateAuthorized" => $dateAuthorized,
                         
    "dateCaptured" => $dateAuthorized);
                         
        
    $client func_taxcloud_get_client();

        
    // The authorizedResponse array contains the response verification (Error, OK, ...)
        
    $authorizedResponse null;
        try {
            
    $authorizedResponse $client->authorizedWithCapture$params );    

        } catch (
    Exception $e) {

            
    //infrastructure error, try again    
            
    try {
                
    $authorizedResponse $client->authorizedWithCapture$params );

                
    $authorizedResult $authorizedResponse->{'AuthorizedWithCaptureResult'};        
                if (
    $authorizedResult->ResponseType != 'OK') {
                    
    $msgs $authorizedResult->{'Messages'};
                    
    $respMsg $msgs->{'ResponseMessage'};
            
                    
    //duplicate means the the previous called was good. Therefore, consider this to be good
                    
    if (trim ($respMsg->Message) == $dup) {
                        return 
    1;
                    }
                } else if (
    $authorizedResult->ResponseType == 'Error') {
                    
    $msgs $authorizedResult->{'Messages'};
                    
    $respMsg $msgs->{'ResponseMessage'};
                    
    //duplicate means the the previous called was good. Therefore, consider this to be good
                    
    if (trim ($respMsg->Message) == $dup) {
                        return 
    1;
                    } else {
                        
    $errMsg[] = "Error encountered looking up tax amount ".$respMsg;
                        return -
    1;
                    }
                } else {
                    return -
    1;
                }
                
            } catch (
    Exception $e) {
                
    //give up
                
    $errMsg[] = $e->getMessage();
                return 
    0;
            }
        }

        
    $authorizedResult $authorizedResponse->{'AuthorizedWithCaptureResult'};
        if (
    $authorizedResult->ResponseType == 'OK') {
            
    $_SESSION['singlePurchase'] = null;   //one-time certificate
            
    $_SESSION['selectedCertID'] = null;  //saved certificate
        //    $_SESSION['taxcloudTaxTotal'] =  null;
            
    return 1;
        } else {
            
    $msgs $authorizedResult->{'Messages'};
            
    $respMsg $msgs->{'ResponseMessage'};                
            
            
    $errMsg [] = $respMsg->Message;
            return 
    0;
        }        
        
        return 
    $result;    
    }

    function 
    func_taxcloud_add_exemption_certificate($exemptionCertificate,$customerID) {
        global 
    $client;
        
        
    $params = array( "apiLoginID" => TAXCLOUD_API_ID,
                         
    "apiKey" => TAXCLOUD_API_KEY,
                         
    "customerID" => $customerID,
                          
    "exemptCert" => $exemptionCertificate 
                          
    );
        try {
            
    $client func_taxcloud_get_client();
            
    $addExemptionResponse $client->addExemptCertificate$params );

        } catch (
    Exception $e) {
            return -
    1;
        }

    }

    function 
    func_taxcloud_get_exemption_certificates($customerID) {
        global 
    $client;
        
        
    $params = array( "apiLoginID" => TAXCLOUD_API_ID,
                         
    "apiKey" => TAXCLOUD_API_KEY,
                         
    "customerID" => $customerID
                          
    );
            
        try {
            
    $client func_taxcloud_get_client();
            
    $getExemptCertificatesResponse $client->getExemptCertificates$params );
            
    $getCertificatesRsp $getExemptCertificatesResponse->{'GetExemptCertificatesResult'};
            
    $exemptCertificatesArray $getCertificatesRsp->{'ExemptCertificates'};
            
    $exemptCertificates $exemptCertificatesArray->{'ExemptionCertificate'};
            
            if (
    is_array($exemptCertificates)) {
                return 
    $exemptCertificates;
            } else {
                return 
    $exemptCertificatesArray;
            }
            
        } catch (
    Exception $e) {
            return Array();
        }
        return Array();
    }

    function 
    func_taxcloud_delete_exemption_certificate($certID) {
        
        global 
    $client;
        
        
    $params = array( 
             
    "apiLoginID" => TAXCLOUD_API_ID,
            
    "apiKey" => TAXCLOUD_API_KEY,
            
    "certificateID" => $certID
        
    );
        
        try {
            
    $client func_taxcloud_get_client();
            
    $deleteExemptCertificateResponse $client->deleteExemptCertificate$params );

        } catch (
    Exception $e) {
            return -
    1;
        }
    }


    function 
    func_taxcloud_return_order($order_id) {   

        global 
    $client;
        
        global 
    $db;
        
        
    $results $db->Execute("select products_id, products_quantity, final_price
                             from " 
    TABLE_ORDERS_PRODUCTS "
                                 where orders_id = '" 
    . (int)$order_id "'");
            
        
    $cartItems = Array();

        
    $index 0;
            
            while ( !
    $results->EOF ) {
                
    $fields $results->fields;
                  
                  
    $cartItem = new CartItem();
            
    $cartItem->setItemID($fields['products_id']);
            
    $cartItem->setIndex($index);
            
    $cartItem->setTIC(func_taxcloud_get_tic($fields['products_id']));  
            
    $cartItem->setPrice($fields['final_price']);
            
    $cartItem->setQty($fields['products_quantity']);
            
    $cartItems[$index] = $cartItem;
                  
                  
    $index++;
                  
    $results->MoveNext();
                  
            }
            
            
    //Reverse the order shipping
        
    $results $db->Execute("select value
                                from " 
    TABLE_ORDERS_TOTAL "
                                    where orders_id = '" 
    . (int)$order_id "'
                                    and class = 'ot_shipping'"
    );
            
            while ( !
    $results->EOF ) {
                
    $fields $results->fields;
                  
            
    //Shipping as a cart item
            
    $cartItem = new CartItem();
            
    $cartItem->setItemID('shipping');
            
    $cartItem->setIndex($index);
            
    $cartItem->setTIC(11010);
            
    $cartItem->setPrice($fields['value']);
            
    $cartItem->setQty(1);
            
    $cartItems[$index] = $cartItem;    
                   
                  
    $index++;
                  
    $results->MoveNext();
                  
            }
            
        
    $returnDate date("Y-m-d");
        
    $returnDate $returnDate "T00:00:00";
        
        
    $params = array(
            
    "apiLoginID" => TAXCLOUD_API_ID,
            
    "apiKey" => TAXCLOUD_API_KEY,
            
    "orderID" => $order_id,
            
    "cartItems" => $cartItems,
            
    "returnedDate" => $returnDate); 
        
        try {
            
    $client func_taxcloud_get_client();
            
    $returnResponse $client->Returned($params);    
        } catch (
    Exception $e) { 
            return -
    1;
        }

    }
    ?>
    How do I determine the ownership and permissions?

  6. #116
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: TaxCloud Addon

    most ftp clients should show the permissions as well as the owner and group. you can try right clicking the filename from within the ftp client that you are using to possibly access the data. its not too hard to see, but you need to look.

    i'm thinking that most of these should be 644; but the proper owner/group combo is something that your host can help you with. else you should compare it to other files in a similar tree, ie:

    includes/modules/order_total/ot_total.php

    as this looks to be a new directory, you would also need to check the ownership/permissions of

    includes/modules/TaxCloud

    i find it highly unlikely that line 34 of includes/classes/order.php is incorrect; as i see that line as part of the download, but we could look at changing that line as a last resort. it is more likely a permissions issue.

    again, you can ask your host if the permissions are correct for this file. depending on the host, they may be able to help you.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #117
    Join Date
    Apr 2012
    Location
    Los Angeles, CA
    Posts
    185
    Plugin Contributions
    2

    Default Re: TaxCloud Addon

    Quote Originally Posted by carlwhat View Post
    most ftp clients should show the permissions as well as the owner and group. you can try right clicking the filename from within the ftp client that you are using to possibly access the data. its not too hard to see, but you need to look.

    i'm thinking that most of these should be 644; but the proper owner/group combo is something that your host can help you with. else you should compare it to other files in a similar tree, ie:

    includes/modules/order_total/ot_total.php

    as this looks to be a new directory, you would also need to check the ownership/permissions of

    includes/modules/TaxCloud

    i find it highly unlikely that line 34 of includes/classes/order.php is incorrect; as i see that line as part of the download, but we could look at changing that line as a last resort. it is more likely a permissions issue.

    again, you can ask your host if the permissions are correct for this file. depending on the host, they may be able to help you.

    best.
    So, I found out that the permissions were correct 640. Unfortunately I am going to have to let go of this module. I really like taxcloud as it makes my tax collection and filings easier. So I deleted all of the files and replaced the core files with copies from a fresh ZC 1.5.6 installation. Everything is back to normal.

    I guess I am just not cut out for all the extra stuff anymore, code makes my head hurt, and I have a small business to run so my time is limited more than ever now.

  8. #118
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    red flag Re: TaxCloud Addon

    Oddly TaxCloud 16b installed once on a clean Zen Cart 1.55f but only recorded the first configuration setting - 'TaxCloud Configuration Settings'.

    That resulted in the lookup code for the other configuration settings to fail to fire.


    There was no error message but the problem behaviour was that I could enter in all of my TaxCloud data in Admin > Locations/Taxes > TaxCloud Tax Calculation

    and...


    It would 'update' and show the data again on-screen - but the data wouldn't commit to the database and TaxCloud Enabled would remain 'false'.

    Reload the page and it would all be blank again.

    Because the code could see - 'TaxCloud Configuration Settings' it failed to load these tables into the db:
    'TaxCloud API ID', 'TaxCloud API Key', 'USPS_ID', 'Store Street Address', 'Store Zip Code', 'TaxCloud Enabled'


    The Fix:

    - Remove all entries of TaxCloud in the configuration and configuration_group
    - Log into Zen Admin
    - Navigate to Admin > Locations/Taxes > TaxCloud Tax Calculation
    - Enter Data

    Success!


    The code then fires correctly and installs the tables correctly.


    I've installed a lot of modules over the years and occasionally 'removing and reinstalling' the files doesn't work and some modules do not have SQL database removal codes - in this case manually removing everything from the SQL database and reinstalling it DID work.

    Important to note that the TaxCloud 16b fileset was intact, complete and merged properly on the server and - remains intact.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  9. #119
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    bug Re: TaxCloud Addon

    Problem - TaxCloud is using full names for state zones, Zen is using 2 digits.


    Zen posted this on-screen error in checkout_payment page during checkout:


    Error encountered looking up tax amount The Ship To zip code (89128) is not valid for this state (Ne)


    The fix:
    This works and was a necessary update after install and testing failed to load the 2 digit state codes correctly out of the TaxCloud 16b box:

    https://www.zen-cart.com/showthread....03#post1343603


    Quote Originally Posted by infinigrove View Post
    I see this thread is a year old but I was having the same problem with the latest version of the TaxCloud module with ZC v1.5.5f

    It was giving me "Error encountered looking up tax amount The Ship To State (Ne) is not valid" when trying to do New York (NY) state or any other state where the 2-Letter state code was not the first 2 characters of the state name.

    What I did to resolve this issue is first modify includes/classes/order.php to lookup the zone_code in the $shipping_address_query around line 270 by changing:
    $shipping_address_query = "select ab.entry_firstname, ab.entry_lastname, ab.entry_company,
    ab.entry_street_address, ab.entry_suburb, ab.entry_postcode,
    ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id,
    c.countries_id, c.countries_name, c.countries_iso_code_2,

    to
    $shipping_address_query = "select ab.entry_firstname, ab.entry_lastname, ab.entry_company,
    ab.entry_street_address, ab.entry_suburb, ab.entry_postcode,
    ab.entry_city, ab.entry_zone_id, z.zone_name, z.zone_code, ab.entry_country_id,
    c.countries_id, c.countries_name, c.countries_iso_code_2,


    Then I added a state_code to the delivery array that contains the zone_code around line 424.
    So that this:
    $this->delivery = array('firstname' => $shipping_address->fields['entry_firstname'],
    'lastname' => $shipping_address->fields['entry_lastname'],
    'company' => $shipping_address->fields['entry_company'],
    'street_address' => $shipping_address->fields['entry_street_address'],
    'suburb' => $shipping_address->fields['entry_suburb'],
    'city' => $shipping_address->fields['entry_city'],
    'postcode' => $shipping_address->fields['entry_postcode'],

    Now looks like:
    $this->delivery = array('firstname' => $shipping_address->fields['entry_firstname'],
    'lastname' => $shipping_address->fields['entry_lastname'],
    'company' => $shipping_address->fields['entry_company'],
    'street_address' => $shipping_address->fields['entry_street_address'],
    'suburb' => $shipping_address->fields['entry_suburb'],
    'city' => $shipping_address->fields['entry_city'],
    'postcode' => $shipping_address->fields['entry_postcode'],
    'state_code' => $shipping_address->fields['zone_code'],



    Then I modified the includes/modules/TaxCloud/func.taxcloud.php to use the state_code instead to the state on line 98 by replacing:

    $destination->setState($delivery['state']); // Two character state appreviation

    with

    $destination->setState($delivery['state_code']); // Two character state abbreviation

    Hope this helps.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  10. #120
    Join Date
    Apr 2012
    Location
    Los Angeles, CA
    Posts
    185
    Plugin Contributions
    2

    Default Re: TaxCloud Addon

    Important to note that the TaxCloud 16b fileset was intact, complete and merged properly on the server and - remains intact.
    I am catching my 2nd wind on this mod. It truly pisses me off every time it comes times to upgrade Zen Cart...I had to go back to zc 1.5.5f when I ran into issues with one of the most vital plug-ins used on my site. Anyhow, I digress, I keep noticing that the admin//includes/auto_loaders/config.taxcloud.php keeps disappearing. I upload it again, leave that area of cPanel and when I come back it is just gone. But the plug in is working fine. Is there a reason why a file would just disappear like that?

 

 
Page 12 of 16 FirstFirst ... 21011121314 ... LastLast

Similar Threads

  1. v152 Problems with TaxCloud
    By retched in forum All Other Contributions/Addons
    Replies: 20
    Last Post: 11 May 2014, 05:47 AM
  2. v151 Should TaxCloud be passing State Code or State name to TaxCloud for verification?
    By RCwebdev in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Dec 2013, 10:16 PM
  3. v150 Taxcloud and TICs
    By Sanguinarius in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 7
    Last Post: 1 Apr 2013, 06:54 PM
  4. v151 can the taxcloud addon be tested within local wamp development server??
    By tlyczko in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 4 Dec 2012, 08:37 PM
  5. v151 Issues Installing TaxCloud Addon
    By DK07 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 10 Oct 2012, 04:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR