Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Possible logic bug in zone comparisions

    I I had a problem where the tax was not being calculated once I logged in. Turns out my problem was this piece of code in functions_taxes.php:

    PHP Code:
        if (STORE_PRODUCT_TAX_BASIS == 'Store') {
          if (
    $zone_id != STORE_ZONE) return 0;
        } 
    Being in Ireland we do not have zones (there's counties but there would not be a different VAT rate per county). And I have the tax basis set to store. However, sometime in the past I had created a zone just called "Republic of Ireland" and set the Store Zone to that. I subsequently deleted it. This left my Store Zone reading "190" (the zone ID of the deleted record) with no way to clear it in the configuration. I ended up setting to 0 via SQL.

    My suggested change to the code would be:

    PHP Code:
        if (STORE_PRODUCT_TAX_BASIS == 'Store' && STORE_ZONE!=0) {
          if (
    $zone_id != STORE_ZONE) return 0;
        } 
    And also if STORE_ZONE==Zone being deleted UPDATE SET STORE_ZONE=0
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Possible logic bug in zone comparisions

    However, sometime in the past I had created a zone just called "Republic of Ireland" and set the Store Zone to that. I subsequently deleted it.
    And it appears that you then did not reset the store zone to anything
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Possible logic bug in zone comparisions

    You can't- the drop down is empty. Hence the bug.
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Possible logic bug in zone comparisions

    You should set a Zone even if all the UK countries - what if a USA or AU tries to but from your shop?

    Zones does not specifically mean postal zones from the script perspective it is what ever you define it to be
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Possible logic bug in zone comparisions

    I would expect in that instance that the fall back would be country rather than zone.

    And the ROI is not in the UK. I don't mind but many do...
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Possible logic bug in zone comparisions

    I would expect in that instance that the fall back would be country rather than zone.

    And the ROI is not in the UK. I don't mind but many do...
    But it could be in a zone that you define...

    I would suspect that the "bug" is that when the set zone is deleted from the admin that the DB entry is not
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Sep 2007
    Location
    Dublin, Ireland
    Posts
    1,288
    Plugin Contributions
    8

    Default Re: Possible logic bug in zone comparisions

    Quote Originally Posted by kobra View Post
    I would suspect that the "bug" is that when the set zone is deleted from the admin that the DB entry is not
    Correct- hence my pseudo-code suggestion in the root
    Andrew

    Andrew Moore
    Omnicia Agile Development
    www.omnicia.com

 

 

Similar Threads

  1. Replies: 2
    Last Post: 23 Jul 2015, 04:47 AM
  2. zone shipping bug?
    By venablc in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 25 Sep 2013, 07:27 PM

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