Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 41
  1. #21
    Join Date
    Jul 2006
    Posts
    25
    Plugin Contributions
    0

    Idea or Suggestion Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Ok guys... i think i've found a fix...

    After some analisys i think i found it... well.. if this "add address" process is ok when creating a new account this would mean that the code is already implemented. So the problem was that this wasn't being checked when adding a new address from on other page besides the initial "new account".

    I found that the code in question is :

    PHP Code:
      if (ACCOUNT_STATE == 'true' && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true') {
        
    $zone_id 0;
        
    $check_query "select count(*) as total
                          from " 
    TABLE_ZONES "
                          where zone_country_id = '" 
    . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY "'";
        
    $check $db->Execute($check_query);
        
    $entry_state_has_zones = ($check->fields['total'] > 0);
        if (
    $entry_state_has_zones == true) {
          
    $zones_array = array();
          
    $zones_array[] = array('id' => PULL_DOWN_ALL'text' => PULL_DOWN_ALL);
          
    $zones_values $db->Execute("select zone_name
                                       from " 
    TABLE_ZONES "
                                       where zone_country_id = '" 
    . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY "'
                                       order by zone_name"
    );
          while (!
    $zones_values->EOF) {
            
    $zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
            
    $zones_values->MoveNext();
          }
        }
      } 

    where
    PHP Code:
    ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true' 
    would be the dropdown checking that wasn't being checked.


    So.. my advise is always to backup before doing what i am going to explain next.

    Hey.. BACKUP!!


    Just insert this piece of code on the includes/modules/checkout_new_address.php so it becomes like this :
    (comented code is new to the file)

    PHP Code:
    <?php
    /**
     * checkout_new_address.php
     *
     * @package modules
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: checkout_new_address.php 3777 2006-06-15 07:03:03Z drbyte $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die(
    'Illegal Access');
    }


    /** 
     * NEW CODE FROM THIS POINT ON
     */


     
    if (ACCOUNT_STATE == 'true' && ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true') {
        
    $zone_id 0;
        
    $check_query "select count(*) as total
                          from " 
    TABLE_ZONES "
                          where zone_country_id = '" 
    . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY "'";
        
    $check $db->Execute($check_query);
        
    $entry_state_has_zones = ($check->fields['total'] > 0);
        if (
    $entry_state_has_zones == true) {
          
    $zones_array = array();
          
    $zones_array[] = array('id' => PULL_DOWN_ALL'text' => PULL_DOWN_ALL);
          
    $zones_values $db->Execute("select zone_name
                                       from " 
    TABLE_ZONES "
                                       where zone_country_id = '" 
    . (int)SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY "'
                                       order by zone_name"
    );
          while (!
    $zones_values->EOF) {
            
    $zones_array[] = array('id' => $zones_values->fields['zone_name'], 'text' => $zones_values->fields['zone_name']);
            
    $zones_values->MoveNext();
          }
        }
      }[/
    B]

    /** 
     * NEW CODE ENDED HERE
     */

    /**
     * determine pulldown menu contents if appropriate
     */

    Give it a try... and post some feedback. Hope i got it... and remember.. always backup!! ;)
    Last edited by joanorsky; 4 Aug 2006 at 04:07 PM.

  2. #22
    Join Date
    May 2005
    Posts
    361
    Plugin Contributions
    2

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    joanorsky,
    This fix seems to be working for me.
    Thanks!!
    LadyHLG

  3. #23
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    It looks like this fix only works if admin > configuration > customer details > state always display as pulldown = true.

    Unfortunately, if you are sending anywhere but the US, that method forces non-US addresses to choose US states, right?

    Anyone have a fix for this? It's a sale-killer.

    Since we have very few international orders I might use it for now.

    ---Diana

  4. #24
    Join Date
    Jul 2006
    Posts
    25
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Quote Originally Posted by dbrewster
    It looks like this fix only works if admin > configuration > customer details > state always display as pulldown = true.

    Unfortunately, if you are sending anywhere but the US, that method forces non-US addresses to choose US states, right?

    Anyone have a fix for this? It's a sale-killer.

    Since we have very few international orders I might use it for now.

    ---Diana

    Well this fix is only for the pulldown = true condition... but it works on all countries. You just have to insert the zones manually.. otherwise it will fail.. of course..


    ... maybe i did not understood your meaning...

  5. #25
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Quote Originally Posted by joanorsky
    Well this fix is only for the pulldown = true condition... but it works on all countries. You just have to insert the zones manually.. otherwise it will fail.. of course.
    Well, even for countries that have some zones in the database, the drop menu does not show them. If I say I am shipping to Switzerland, I see a drop list with... US states in it.

    So, international shipping is broken for me until we have a fix.

    Not that we do much of that at all, but, still.

    but perhaps I have a misconfiguration somewhere? suggestions??

  6. #26
    Join Date
    Aug 2006
    Posts
    27
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    This fixed it!!!

    I just had to remove: [/b] from the posted code and after doing 1 hour of testing with the address book, taxes are being charged correctly.

    Thanks so much for posting the solution!

    Gisèle Grenier

  7. #27
    Join Date
    Jul 2005
    Location
    Charlottesville, VA
    Posts
    431
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    This code still does not handle where a country has no zones in the zones table (i.e. states or provinces), when you choose state droplist required.

    There is another bug with this code: if you want to change your mailing address to a different country, you only see a drop list for states for your original country.

    We have lost some international orders because of this... however, we have very few international orders, so it's not a big issue for us.

    If I remove the requirement for the drop list of states, then international orders work (except for those countries that always mysteriously fail USPS delivery, such as Cyprus and Switzerland, which may be due to a bug in USPS code.)

    ---Diana

  8. #28
    Join Date
    Mar 2006
    Location
    Durham, UK
    Posts
    84
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Quote Originally Posted by Ajeh
    A nice fix is coming ... thanks for the updates ...
    There's an old adage that says that out of 'quick', 'cheap' and 'good', you can't have more than 2 at the same time. So if it's 'free' and you want it 'good', then it can't be quick. All of which is by way of saying that I'm ashamed to admit that news of a Zen core-team fix for what has always been one of the major bug-bears in the osC/Zen create account interface - the defined State/Zone kick-back problem - put me in a state roughly equivalent to a 5-year-old waiting for Christmas. If Ajeh says it's good, then it must be good! I know that asking when it might be ready is about as inappropriate as asking Father Christmas to get-a-move-on down the chimney. But I can't help myself. Just don't kick me too hard! Pleez?

  9. #29
    Join Date
    Sep 2006
    Posts
    10
    Plugin Contributions
    0

    Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Help! My includes/modules/checkout_new_address.php file doesn't look anything like the one with the fix. It is only two lines of code long! It only mentions templates. Also, I have noticed that with an existing address or one on file it is not adding tax nor adding weights to change the shipping! Any thoughts?

    John

  10. #30
    Join Date
    Mar 2006
    Location
    Durham, UK
    Posts
    84
    Plugin Contributions
    0

    Default Re: ZC 1.3.0.2 will not calculate tax, entering state/province bug

    Quote Originally Posted by medicman47
    Help! My includes/modules/checkout_new_address.php file doesn't look anything like the one with the fix. It is only two lines of code long! It only mentions templates.
    Check which ZC version you installed. (-> Admin -> Tools -> Server Info).

    Is it 1.2.x?

    The code was changed quite significantly for the 1.3 series. As far as I'm aware this particular bug only appeared in v.1.3.0.2 - which is what this thread refers to
    Quote Originally Posted by medicman47
    Also, I have noticed that with an existing address or one on file it is not adding tax
    Check:
    i) the addresses you're testing are located within a Zone defined in -> Admin -> Locations / Taxes -> Zones Definitions
    ii) the tax class(es) relevant to those addresses are defined in -> Admin -> Locations / Taxes -> Tax Classes
    iii) the relevant Tax Classes are linked to the relevant defined zones with the relevant tax rate in -> Admin -> Locations / Taxes -> Tax Rates
    Quote Originally Posted by medicman47
    nor adding weights to change the shipping! Any thoughts?
    Check:
    i) the products in your cart have weights assigned in ->Admin -> Catalog -> Categories/Products
    ii) your shipping method is based on weight rather than price (-> Admin -> Modules -> Shipping -> )

 

 
Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 9 Apr 2016, 07:53 PM
  2. Replies: 4
    Last Post: 24 Jul 2010, 01:06 PM
  3. Replies: 19
    Last Post: 6 Feb 2007, 03:41 AM
  4. Tax will not calculate
    By Niaknow in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 11
    Last Post: 22 Aug 2006, 04:19 AM

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