Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36
  1. #21
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    We have a hiccup today. Customer address is in the Netherlands and is receiving the Brexit ERROR during checkout.

    zen-cart 1.5.6.c

    I changed the
    Code:
    Zone Description:  [135:GBP:Deny]
    by removing the : deny (without the spaces) and the error goes away.

    Based upon the To Use notes, my original steps were:

    Create/Insert Zone Definition:
    Zone Name: UK-Brexit
    Zone Description: [135:GBP: deny] no spaces
    Status: yellow

    UK-Brexit Zone Name details:
    Country: United Kingdom
    Zone: All Zones

    Note: Nothing done to the other 3 zone definitions: Idaho, International, USA

    Customer in the Netherlands logs into their account, adds items to cart and begins checkout process.
    Error message
    ERROR: Orders to this destination must be greater than £135
    Currency selected: USD
    Currency is updated every 3rd day by CRON and was last updated 3/25/2021 @ 10am PDT

    I cannot do anything to troubleshoot until after the affected customer places their order, which I expect sometime today.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  2. #22
    Join Date
    Apr 2009
    Posts
    416
    Plugin Contributions
    2

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    I had a similar problem when i was testing this. I did find a sloution but my test machine died. I'll try to reproduce again and let you know what i did. I think I changed zone_id to Null from 0 because if the country id does not have a tax rate then it assumes 0 for the zone_id and if you have any countries with the deny set then they are picked up. I'll have a more detaile look and see if i can post a suggested fix other than changing the data.
    Bit of code causing issue is the select line 148.
    PHP Code:
     $sql "SELECT geo_zone_description 
                    FROM " 
    TABLE_GEO_ZONES 
                    INNER JOIN " 
    TABLE_ZONES_TO_GEO_ZONES " za USING (geo_zone_id) 
                    WHERE zone_country_id = " 
    . (int)$country_id "
                    OR zone_id = " 
    . (int)$zone_id "
                    ORDER BY zone_id DESC"

    Or Zone_id is overriding country code
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  3. #23
    Join Date
    Apr 2009
    Posts
    416
    Plugin Contributions
    2

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Done some more research. This is only an issue if the country you are sending to does not have any regions zones set up. (237 of them)
    I think if i understand the logic correctly that the query should return all tax details for the country code regardless of zone and all zones with no country set.
    therefore i think the sql should be
    Line 148
    PHP Code:
     $sql "SELECT geo_zone_description 
                    FROM " 
    TABLE_GEO_ZONES 
                    INNER JOIN " 
    TABLE_ZONES_TO_GEO_ZONES " za USING (geo_zone_id) 
                    WHERE zone_country_id = " 
    . (int)$country_id "
                    OR (zone_country_id = 0 and zone_id = " 
    . (int)$zone_id ") 
                    ORDER BY zone_id DESC"

    this assumes that 0 is the value used for "all countries" as it is used for "All zones"

    Need someone to check the logic if OK can I make change but don't know where the source is.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  4. #24
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Mark,

    I appreciate everything but you are way over my head.

    My pea brain just can't comprehend how Country: The Netherlands is affected by code that is supposed to only be Country: United Kingdom
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  5. #25
    Join Date
    Apr 2009
    Posts
    416
    Plugin Contributions
    2

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    The issue is in the logic. I have put it there for Dr Byte to check that i have understood it correctly.
    When you add a rule to a country for all zones it sets it up with a zone_id of zero meaning to apply to all zones in the country.
    The issue is that when you have a country with no zones in it then its zone id defaults to 0 this causes the select to return the deny rule you have set up for all zones regardless of country.

    I have tested this on my test site and it works fine. I will have an issue with the whole of the EU from June 1 so i want to deny all orders there below a limit.
    when I set it up it worked fine for all countries i had set up but just like you it also blocked payments to non EU countries that did not have zones.
    The Netherlands is effected because the query is bringing back the UK rule as the zone_id in the Netherlands is 0.

    The two ways of fixing it i have found are the code change above.
    or changing the zone_id to Null in the database. Both worked in testing. I prefer the former as it should be a permanent fix. But as it is not my code i cannot say if I have completely understood the logic. If i have then great and hopefully Dr Byte will amend or allow me to amend the file.

    Not sure if that helps or not.
    Last edited by brittainmark; 29 Mar 2021 at 09:02 PM.
    Mark Brittain
    http:\\innerlightcrystals.co.uk\sales\

  6. #26
    Join Date
    Aug 2009
    Location
    North Idaho, USA
    Posts
    2,008
    Plugin Contributions
    1

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Thanks Mark

    That explanation does help.
    Rick
    RixStix (dot) com
    aka: ChainWeavers (dot) com

  7. #27
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Yes, brittainmark's query should be fine.

    Updated version attached.
    Attached Files Attached Files
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #28
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    75
    Plugin Contributions
    0

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Thanks, DrByte. I'm continually amazed at how flexible a system Zen Cart is. I had been chasing my tail trying to come up with a solution for this (or find a Zen Cart expert I could pay to do it) and I can't believe I missed this thread.

    One thing I don't see mentioned in the thread, and I realise it will be irrelevant to many Zen Cart stores, is that the rule being implemented for both EU and UK customers only applies to B2C transactions. B2B transactions should not include VAT no matter what the order value. I assume this is because business customers have no mechanism to reclaim VAT paid on purchases from foreign sellers.
    As far as I can see, the definition of a "business" customer in this context is one that holds an EORI number. So a complete solution would capture an EORI number in the customer details, if they have one. Then we would only charge VAT if ((zone requires it) and (order_value <= threshold) and (customer EORI exists))

    This requires a change outside DrByte's class but it won't be too hard to do (unless you want to verify the EORI number's validity online at the point of capture rather than checking it manually prior to shipping) and as I say, won't be a requirement for the majority of stores.
    Last edited by BillJ; 3 Jun 2021 at 09:23 AM.

  9. #29
    Join Date
    Sep 2013
    Location
    Devon, UK
    Posts
    75
    Plugin Contributions
    0

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Quote Originally Posted by BillJ View Post
    Then we would only charge VAT if ((zone requires it) and (order_value <= threshold) and (customer EORI exists))
    Oops!
    I meant: Then we would only charge VAT if ((zone requires it) and (order_value <= threshold) and (customer EORI *does not* exist))

  10. #30
    Join Date
    Mar 2011
    Posts
    78
    Plugin Contributions
    0

    Default Re: BREXIT: Set minimum order requirement for UK addresses

    Finally getting round to testing this out as I've found a cost effective way to file IOSS VAT returns.
    However I can't get it to work.
    ZC1.57c
    I am using a shipping address in Belgium to test on my dev site.
    I want the relevant zone tax added only up to 130GBP. Excluded above.

    Zone name: Belgium IOSS
    Zone Description: [130:GBP]
    Zone Name details:
    Country: Belgium
    Zone: All Zones

    VAT is correctly added at the correct rate for the zone.
    However it doesn't exclude VAT over £130.
    When I have this installed it also messes up the VAT calculation displayed at checkout. It only shows the VAT amount on the shipping, even though the product price is still showing VAT included. Remove it and the VAT shown is correct for the total order value including shipping.
    If I change shipping tax class to NONE it doesn't show any tax line, even though the totals are showing correct for including tax.

    I even changed the shipping to be over £130 just to see if it would exclude VAT on the shipping and it didn't.

    I'm completely flummoxed on this one.
    I assume it's something I've done/not done.
    The file just needs to be uploaded without any editing, right? It just looks for the relevant language in the zone descriptions, which I have set up.

    Any ideas would be appreciated.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v151 including shipping costs to order total for VAT calculation and incorrect VAT
    By McLovin in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 9 Nov 2014, 12:31 PM
  2. Setting minimum order for check/money order only
    By coldspag in forum Managing Customers and Orders
    Replies: 0
    Last Post: 26 Nov 2008, 02:18 PM
  3. VAT number requirement for customers
    By Janneman664 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 13 Sep 2007, 11:00 AM
  4. Minimum purchase requirement for Discount Group
    By MichellyAqua12 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 14 Mar 2007, 08:30 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