chrish123 Posted April 14, 2008 Posted April 14, 2008 Hi, I recently had a customer ask me to take the VAT off the price as he is based in the Channel islands in Guernsey. I did a little research and this is correct, you have to deduct VAT if your VAT registered and they are located in the Channel Islands. If this was achieved by County names, then you could have a problem with Alderny being the first county in the UK database which would then give people items tax free! if they failed to enter a county name, as this would get filled in automatically to "Alderny". I managed to download a postcode database and its all OK within the Zones, How would I get this to deduct the 17.5% tax on certain postcodes at checkout? Basically only postcodes starting with the below are excluded from VAT: GY1 GY2 GY3 GY4 GY5 GY6 GY7 GY8 GY9 JE1 JE2 JE3 JE4 Any form of help will be greatly appreciated! Kind regards Chris
♥FWR Media Posted April 14, 2008 Posted April 14, 2008 Try the following: - $pre1 = "/JE[1-4]/"; $pre2 = "/GY[1-9]/"; if ( preg_match($pre1, strtoupper(substr($postcode , 0, 3))) || preg_match($pre2, strtoupper(substr($postcode, 0, 3))) ) { // Channel islands } // NOT Channel islands $postcode needs to be corrected to the relevant variable ofc. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted April 14, 2008 Posted April 14, 2008 I only gave it a quick look and it is thoroughly untested but you could try the following: - catalog/includes/classes/orders.php Find .. $products_tax = $this->products[$index]['tax']; $products_tax_description = $this->products[$index]['tax_description']; replace with .. // BOF FWR Channel Islands hack //$products_tax = $this->products[$index]['tax']; //$products_tax_description = $this->products[$index]['tax_description']; $pre1 = "/JE[1-4]/"; $pre2 = "/GY[1-9]/"; if ( preg_match($pre1, strtoupper(substr($billing_address['entry_postcode'] , 0, 3))) || preg_match($pre2, strtoupper(substr($billing_address['entry_postcode'], 0, 3))) ) { $this->products[$index]['tax'] = 0; $products_tax = $this->products[$index]['tax']; $this->products[$index]['tax_description'] = 'Tax free Channel Islands'; $products_tax_description = $this->products[$index]['tax_description']; } else { $products_tax = $this->products[$index]['tax']; $products_tax_description = $this->products[$index]['tax_description']; } // EOF FWR Channel Islands hack Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
chrish123 Posted April 15, 2008 Author Posted April 15, 2008 Hi, Thank you Robert for the effort, but this unfortunately does not seem to work, at least here on RC1, I checked this with secpay/paypal and cheque/moneyorder and the order total still includes the VAT. I will have a fiddle with it again later to double check. Kind regards Chris I only gave it a quick look and it is thoroughly untested but you could try the following: - catalog/includes/classes/orders.php Find .. $products_tax = $this->products[$index]['tax']; $products_tax_description = $this->products[$index]['tax_description']; replace with .. // BOF FWR Channel Islands hack //$products_tax = $this->products[$index]['tax']; //$products_tax_description = $this->products[$index]['tax_description']; $pre1 = "/JE[1-4]/"; $pre2 = "/GY[1-9]/"; if ( preg_match($pre1, strtoupper(substr($billing_address['entry_postcode'] , 0, 3))) || preg_match($pre2, strtoupper(substr($billing_address['entry_postcode'], 0, 3))) ) { $this->products[$index]['tax'] = 0; $products_tax = $this->products[$index]['tax']; $this->products[$index]['tax_description'] = 'Tax free Channel Islands'; $products_tax_description = $this->products[$index]['tax_description']; } else { $products_tax = $this->products[$index]['tax']; $products_tax_description = $this->products[$index]['tax_description']; } // EOF FWR Channel Islands hack
Guest Posted April 15, 2008 Posted April 15, 2008 Wouldn't it be easier to use a UK Counties contribution which I think should list all the counties in the State box. Then set up your tax class for All of UK with the exception of Channel Islands with your VAT. Then list Jersey, Gurnsey, Sark, etc. with no VAT. I think it would be a clean way to do it depending on how may countries you sell to as you might have to do it for all the countires. I am sure you are not the first to run into this problem so I would check the contributions as I am sure your solution is already there as it would affect ALL UK store owners.
Guest Posted April 15, 2008 Posted April 15, 2008 http://www.oscommerce.com/forums/index.php?showtopic=150527 http://www.oscommerce.com/forums/index.php?showtopic=284122
Recommended Posts
Archived
This topic is now archived and is closed to further replies.