Zen Cart Logo
Forums / Currencies & Sales Taxes, VAT, GST, etc. / Configuring Taxes for Canadian Sites/Zones

Configuring Taxes for Canadian Sites/Zones

Sticky

Views: 171,013

Results 281 to 300 of 318
4 Nov 2011, 5:06 PM
#281
ruffendz avatar

ruffendz

New Zenner

Join Date:
Oct 2009
Posts:
17
Plugin Contributions:
0

Configuring Taxes for Canadian Sites/Zones

Hello...can anyone tell me why i am seeing all of my tax zones listed upon checkout please? This is that i see :

NS TAX 15% + Sales Tax + AB TAX 5% + BC TAX 12% + MB TAX 5% + NB TAX 13% + NL TAX 13% + NT TAX 5% + NU TAX 5% + ON TAX 13% + PE TAX 5% + SK TAX 5% + QE TAX 5% + YT TAX 5%:

Any help would be greatly apprecated!

4 Nov 2011, 5:46 PM
#282
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Configuring Taxes for Canadian Sites/Zones

Follow the instructions posted at the beginning and throughout this thread. You clearly did not.

15 Feb 2012, 5:41 PM
#283
crbn8701 avatar

crbn8701

New Zenner

Join Date:
Feb 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Hello, everybody,

Can you advice how to set Taxes part in Administrator back-end for a business that is not required to collect taxes (below threshold $30,000), not for goods, not for shipping?

Appreciate your help.
Helen

15 Feb 2012, 6:16 PM
#284
newagekat avatar

newagekat

Zen Follower

Join Date:
Nov 2005
Location:
Vancouver, Canada
Posts:
151
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Why are you setting up taxes if you are not registered or required to collect ?

15 Feb 2012, 6:56 PM
#285
crbn8701 avatar

crbn8701

New Zenner

Join Date:
Feb 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

newagekat:

Why are you setting up taxes if you are not registered or required to collect ?

:) To be sure that customers will be not charged with taxes...

And seriously, if I understand your answer right, if I leave Tax part in Administrator back-end alone, without any messing with defaults, then taxes will not be charged, not for goods, not for shipping too?

Sorry for making myself unclear.
Helen

16 Feb 2012, 1:37 AM
#286
newagekat avatar

newagekat

Zen Follower

Join Date:
Nov 2005
Location:
Vancouver, Canada
Posts:
151
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

If you don't set up taxes then your customers won't get charged. Be sure to set the sample taxes to 0. These are the samples that come with zc

16 Feb 2012, 1:01 PM
#287
crbn8701 avatar

crbn8701

New Zenner

Join Date:
Feb 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Thank you, this is what I was looking for.
Appreciate your help.
Helen.

19 Jun 2012, 3:49 PM
#288
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Hi
After a lot of searching etc, I have a zencart store in Quebec working correctly with all tax setups etc - I have attached all the settings/instructions that work on my site - which may be of help to you. :smile [Attachment no longer available]

No files to upload, zip safe to open - just a read me text file & image.

NB: This is for version 1.5 - if you are using version 1.3.9h (then don't apply the FIXES to those 2 files)

19 Jul 2012, 8:18 PM
#289
diytools avatar

diytools

Zen Follower

Join Date:
Oct 2008
Location:
Canada
Posts:
120
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

DrByte:

You might find this helpful ... it needs a bit of touching-up, but the basic core is there:
########################################

** THE CONTENTS OF THIS ARTICLE ARE RELEASED UNDER THE GPL ***

Vendors operating in Canada need to accommodate numerous tax configurations to support proper tax collection on sales to customers in provinces where they are registered to sell.
There's a Federal GST, HST, and provincial PST/RST.

Tax Zones / Rates configuration can be a little confusing at times, as the terms are easily and accidentally swapped ... by mistake... thus it's sometimes hard to follow the process through completely.

Hopefully this short article will help clarify.
Some contents originally written by Peter Mosier
Revised for clarity by DrByte

=========================
Understanding Terminology

TAX CLASS = A setting assigned to PRODUCTS and to SHIPPING that's used to calculate final taxes.
TAX ZONE = A regional setting used to help determine tax rates by geography.
TAX RATE = A rate calculated by combining a product's tax class and shipping zone with the relevant tax percentage.

Zen Cart uses SHIPPING ADDRESS to determine appropriate taxes, i.e. which TAX ZONE you are shipping into. NOTE: this is the shipping address, and NOT the billing address.

A TAX RATE is determined by comparing SHIPPING ADDRESS to the Tax ZONE set up for the TAX RATE; and also by Tax Class assigned to each product.

You can only assign ONE TAX CLASS to a product.
In many stores, you will only have one TAX CLASS (GST/HST/PST) since all goods are either taxable or non-taxable.
When would you use different rates? One example would be if, say, CLOTHES were taxed at a different rate than BOOKS which are in turn different from DVDs. You could create a different TAX CLASS for each family ("class") of product in that case.

In the following examples, we will be dealing with only ONE tax CLASS for products.
You likely want the GST for SHIPPING to show up separately, so we will make a separate "TAX CLASS" for "GST on Shipping".

As of Zen Cart v1.3.9, you can set it to split out your taxes to show on separate lines on the customer's order/invoice/receipt.
Or you can have it add all taxes together and just show tax as one subtotal on a single line.


Best part is: IT DOESN'T REQUIRE ANY CONTRIBUTIONS!!!!!
Just a careful setup of the zones.


===================
Step-by-Step SETUP:
===================

STEP (1): Set the location for your store:

Configuration --> My Store

  • Country: Canada
  • Zone: Ontario

========================================================

STEP (2): Create the "Tax Zones". The are geographical regions where a particular set of tax laws applies

Locations/Taxes --> Zones Definitions

Create the Zone for all of Canada

  • Zone Name: Canada GST Zone
  • Description: GST (except HST Zones)

Now click on the newly created "Canada GST Zone" row to drill down one level to "Sub Zones"
Click INSERT to create 8 new sub-zones, one at a time:

  • Country: Canada; Zone: Alberta
  • Country: Canada; Zone: Manitoba
  • Country: Canada; Zone: Northwest Territories
  • Country: Canada; Zone: Nunavut
  • Country: Canada; Zone: Prince Edward Island
  • Country: Canada; Zone: Quebec
  • Country: Canada; Zone: Saskatchewan
  • Country: Canada; Zone: Yukon Territory

==============

Click on "BACK" to go up one level.
Now create the Ontario HST Zone:
Click Insert

  • **Zone Name: ** Ontario HST Zone
  • **Description: ** HST (only when shipping to Ontario)

Now click on the newly created "Ontario HST Zone" row to drill down one level to "Sub Zones"
Click INSERT to create new sub-zone:

  • Country: Canada
  • Zone: Ontario

==============

Click on "BACK" to go up one level.
Now create the BC HST Zone:
Click Insert

  • **Zone Name: ** BC HST Zone
  • **Description: ** HST (only when shipping to BC)

Now click on the newly created "BC HST Zone" row to drill down one level to "Sub Zones"
Click INSERT to create new sub-zone:

  • Country: Canada
  • Zone: British Columbia

==============

Click on "BACK" to go up one level.
Now create the Maritimes HST Tax Zone:
Click Insert

  • Zone Name: Eastern Canada - HST Zone
  • Description: NS, NB, NL

Now click on the newly created "Eastern Canada - HST Zone" row to drill down one level to "Sub Zones"
Click **INSERT **to create new sub-zone:

  • Country: Canada; Zone: Nova Scotia
  • Country: Canada; Zone: New Brunswick
  • Country: Canada; Zone: Newfoundland

==============

Do NOT create a separate Tax ZONE for Shipping. You will simply use the "Canada" tax zone for the GST Shipping tax CLASS (below).

** Important: this means that SHIPPING GST will only be charged to destinations within Canada, but NOT charged on exports. According to Canada Customs & Revenue Agency (1-800-959-5525), you do NOT charge GST on the shipping fee for EXPORTS.
*

========================================================

STEP (3): Create the "Tax Classes"

Note: You can only assign ONE Tax CLASS to a product.
But since we want shipping GST to show up separately, we will make a separate Tax CLASS just for shipping.

Locations/Taxes --> Tax Classes

create TWO (2) tax classes:

  • Tax Class Title: GST/HST/PST Class

  • **Description: ** All taxable goods

  • Tax Class Title: GST on Shipping
    -** Description: ** GST on shipping within Canada

========================================================

STEP (4): TAX RATES

Here is where it all comes together: Tax Rates.
Tax RATES associate Tax ZONES & Tax CLASSES to determine the correct Tax Rate.

HINT: The "DESCRIPTION" is what shows up on the invoice, so use it judiciously!!!!!!!!!!!!!

Locations/Taxes --> Tax Rates

create SEVEN (7) Tax Rates:

  • Tax Class Title: GST/PST/HST Class
  • Zone: Canada GST Zone
  • Tax Rate (%): 5.0000
  • Description: 5.0% GST#99999 99999 RT0001
  • Priority: 1

/*HINT: Insert your Tax Number (RST) as part of DESCRIPTION and it will show up on invoice !!!

  • Tax Class Title: GST/PST/HST Class /* HINT: Yes, this is the same one you just used

  • Zone: Ontario HST Zone

  • Tax Rate (%): 13.0000

  • Description: 13.0% HST (Ontario)

  • Priority: 1
    /*HINT: Insert your Tax Number (RST) as part of DESCRIPTION and it will show up on invoice !!!

  • Tax Class Title: GST/PST/HST Class /* HINT: Yes, this is the same one you just used

  • Zone: BC HST Zone

  • Tax Rate (%): 12.0000

  • Description: 12.0% HST (BC)

  • Priority: 1
    /*HINT: Insert your Tax Number (RST) as part of DESCRIPTION and it will show up on invoice !!!

  • Tax Class Title: GST/PST/HST Class /* HINT: Yes, this is the same one you just used

  • Zone: Eastern Canada - HST Zone

  • Tax Rate (%): 15.0000

  • Description: 15% HST#R99999 9999 RT0001

  • Priority: 1
    /*HINT: Insert your Tax Number (RST) as part of DESCRIPTION and it will show up on invoice !!!

That takes care of taxes on products. And now, the Shipping taxes:

  • Tax Class Title: GST Shipping Class

  • Zone: Canada GST Zone

  • Tax Rate (%): 5.0000

  • Description: 5.0% GST on shipping

  • Priority: 1

  • Tax Class Title: GST Shipping Class

  • Zone: Ontario HST Zone

  • Tax Rate (%): 13.0000

  • Description: 13% shipping HST#99999 9999 RT0001

  • Priority: 1

  • Tax Class Title: GST Shipping Class

  • Zone: Eastern Canada - HST Zone

  • Tax Rate (%): 15.0000

  • Description: 15% shipping HST#99999 9999 RT0001

  • Priority: 1

(Repeat if you have specific provinces with other tax rates for shipping)

/* HINT: The above will calculate PST on shipping. Although there might
/* be a tendency to think of shipping as a PST exempt service, in fact
/* the Ontario Ministry of Finance says that for calculating the PST,
/* "The total selling price includes delivery, mailing, transportation, or
/* handling charges, but does not include the GST". With the above set-up,
/* the PST for the shipping gets calculated (albeit separately).
/* If you wanted them calculated together, you could assign "GST/PST/HST Class"
/* as the Tax Class when setting up the shipping method.
/* Personally, I prefer to break it out separately.

========================================================

STEP (5): Specify the appropriate Tax Class for SHIPPING MODULES

MODULES --> SHIPPING

Edit whichever shipping module(s) you are using.

Tax Class: GST Shipping Class

/* SEE PREVIOUS HINT

========================================================

STEP (6): Specify the appropriate Tax for PRODUCTS

This may take some time....

CATALOG --> Categories/Products

Drill down to each product. Click EDIT

TAX CLASS: "GST/PST/HST CLASS"

==============
The following SQL statement would be helpful:

UPDATE products SET products_tax_class_id = 1 WHERE products_model NOT LIKE 'GIFT%';

> (you'd need to confirm that the desired products_tax_class_id = 1, first )
> ========================================================
> 
> ===============
> Example Output:
> ===============
> 
> Shipping to Ontario:
> 
> Sub-Total: $69.00
> Per Item (Best Way): $10.00
> 13.0% HST (Ontario) RST #99999 9999 RT0001: $8.97
> 13.0% HST (shipping): $ 1.30
> Total: $89.27
> 
> Shipping into the Maritimes zone (NB, NS, or NL):
> 
> Sub-Total: $69.00
> Per Item (Best Way): $10.00
> 13% HST#R99999 9999 RT0001: $8.97
> 13% shipping HST#99999 9999 RT0001: $ 1.30
> Total: $89.27
> 
> Shipping to Canada, but to a zone where *only* GST applies:
> Sub-Total: $69.00
> Per Item (Best Way): $10.00
> 5.0% GST # 99999 9999 RT0001: $ 3.45
> 5.0% GST (shipping): $ 0.50
> Total: $82.95
> 
> Shipping to non-Canada (tax exempt) zone:
> Sub-Total: $69.00
> Per Item (Best Way): $10.00
> Total: $79.00

I follow your setup tax for canada. But I try order get this as follow:

sub-tatal $12.99

$7.89Canada Post (Regular, 2012-07-25):

$2.18HST#804693150 RT0001 + 5.0% GST#804692150 RT0001 + 8.0% PST (Ontario):

$0.00HST#804693150 RT0001:

$0.005.0% GST#804692150 RT0001:

$0.008.0% PST (Ontario):

$0.005.0% GST on shipping:

$0.008.0% PST (shipping):

$23.06Total:

the tax not come out I don't know why?
30 Jul 2012, 11:58 AM
#290
uniline1 avatar

uniline1

New Zenner

Join Date:
Jul 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

I am in Quebec and having trouble getting both the QST and GST to calculte, as provincial tax laws require.

The problem seems to be related to having 2 tax calculations. If I delete one of the taxes, so that, say, there is only the 5% GST, it calculates and displays correctly. But I need 2 tax calculations.

So I add a second rate for Zone = Quebec, same Tax Class, and with the different Tax Rate. Now when I go to Checkout for a shipment to Quebec, the two tax lines are shown, but no calculation - the tax amounts are both $0.00. For the life of me I can't figure out how to make the taxes calculate when there are 2 of them.

I know the individual taxes are correct, since when I delete one Tax Rate, the remaining one calculates correctly. Show Split Tax Lines is set to True, so they are displaying correctly. Just not calculating when there are 2 Tax Rates.

What am I missing here?

30 Jul 2012, 12:19 PM
#291
uniline1 avatar

uniline1

New Zenner

Join Date:
Jul 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Just to add a detail, using compounding Tax Rates is not necessary. The tax rules are 5% GST applied to the SubTotal, then 9.5% QST applied to the SubTotal+GST. However, the latter is the same as 9.975% QST applied to the SubTotal, with the SubTotal, 5% GST and 9.975% QST then arithmetically added to arrive at the total. So it can be either 9.5% QST compounded on 5% GST or 9.975% QST arithmetically added to 5% GST.

30 Jul 2012, 3:20 PM
#292
raydube avatar

raydube

New Zenner

Join Date:
Sep 2006
Posts:
51
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

I'm going to add that this may be a possible bug in version 1.5, as it was working correctly in 1.3.9.

I've found the same issues with my current testing.

Ray

30 Jul 2012, 3:27 PM
#293
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

RayDube:

I'm going to add that this may be a possible bug in version 1.5, as it was working correctly in 1.3.9.

I've found the same issues with my current testing.

Ray

In an earlier thread in this post I uploaded a zip file with all the settings that I used to configure the taxes for Canadian Store in Quebec - mine works as this was on version 1.5. If you read my notes (text file) - there were 2 fixes that I had to apply for version 1.5

FIXES
4A - Compound tax was not working correctly so I applied the following changes to includes/classes/order.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!

  • open includes/classes/order.php and uncomment the if statement on line 523:
    Before = if ($taxDescription == $products_tax_description)...
    After = //if ($taxDescription == $products_tax_description)...

  • and replace:
    Code:

$taxAdd = zen_calculate_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty']

  • zen_round(zen_calculate_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']), $decimals);

with this taken from v1.39:

Code:

$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)

  • zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);

FIXES
5A - Split Tax Shipping and descriptions were not working properly for Compound tax so I applied the following changes to includes/module/order_total/ot_shipping.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!

  • open include/module/order_total/ot_shipping.php and uncomment the following code on line 21:
    Before = unset($_SESSION['shipping_tax_description']);
    After = //unset($_SESSION['shipping_tax_description']);

  • on about LINE 54 look for if ($shipping_tax_basis == 'Billing') {.....

ADD THE FOLLOWING JUST ABOVE THIS - at about line 50
//Begin SplitTaxLines modification
//--------------------------------
if (SHOW_SPLIT_TAX_CHECKOUT == 'false')
{

  • on about LINE 78 look for if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);

ADD THE FOLLOWING JUST BELOW THIS - at about line 79

} else {
//split the taxes
if ($shipping_tax_basis == 'Billing') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif ($shipping_tax_basis == 'Shipping') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
if (STORE_ZONE == $order->billing['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif (STORE_ZONE == $order->delivery['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
$shipping_tax = 0;
}
}

//accumulate taxes from array
foreach ($shipping_tax as $tax_entry_index=>$tax_entry_value)
{
$this_shipping_tax_amount = zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$aggregate_shipping_tax_amount += $this_shipping_tax_amount;
$aggregate_shipping_tax_description += " + " . $shipping_tax_description[$tax_entry_index];
$order->info['tax_groups'][$tax_entry_index] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$order->info['total'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
}
$order->info['shipping_tax'] += $aggregate_shipping_tax_amount;
$order->info['tax'] += $aggregate_shipping_tax_amount;
//preserve aggregate tax descriptions and amounts for session variables
$_SESSION['shipping_tax_description'] = $aggregate_shipping_tax_description;
$_SESSION['shipping_tax_amount'] = $aggregate_shipping_tax_amount;
}

30 Jul 2012, 3:36 PM
#294
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

uniline1:

Just to add a detail, using compounding Tax Rates is not necessary. The tax rules are 5% GST applied to the SubTotal, then 9.5% QST applied to the SubTotal+GST. However, the latter is the same as 9.975% QST applied to the SubTotal, with the SubTotal, 5% GST and 9.975% QST then arithmetically added to arrive at the total. So it can be either 9.5% QST compounded on 5% GST or 9.975% QST arithmetically added to 5% GST.

I used these settings and they work:
I did not include Quebec in the Canada GST Zone - as the store is based in Quebec

Tax Rates
Priority Tax Class Zone Tax Rate Description:
1 GST/HST/PST Canada GST Zone 5.00% 5% GST
1 GST/HST/PST HST Zone - NB, NL, ON 13.00% 13% HST
1 GST/HST/PST HST Zone - NS 15.00% 15% HST
1 GST/HST/PST HST Zone - BC 12.00% 12% HST
2 GST/HST/PST PST Zone - QC 9.50% PST (NB Priority 2 = compounded)
1 GST/HST/PST PST Zone - QC 5.00% GST
1 GST on Shipping HST Zone - BC 12.00% 12% HST
2 GST on Shipping PST Zone - QC 9.50% PST (NB Priority 2 = compounded)
1 GST on Shipping HST Zone - NS 15.00% 15% HST
1 GST on Shipping HST Zone - NB,NL, ON 13.00% 13% HST
1 GST on Shipping PST Zone - QC 5.00% GST
1 GST on Shipping Canada GST Zone 5.00% 5% GST

Screenshot attached of what mine comes out like - version 1.5 Attachment 10907

30 Jul 2012, 3:43 PM
#295
uniline1 avatar

uniline1

New Zenner

Join Date:
Jul 2012
Posts:
4
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

I did look over your solution but I didn't think it should be necessary to make significant changes to the code when all that is necessary is to get two taxes calculating. That's surely meant to be a basic functionality that shouldn't need more than the right settings.

30 Jul 2012, 3:47 PM
#296
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

uniline1:

I did look over your solution but I didn't think it should be necessary to make significant changes to the code when all that is necessary is to get two taxes calculating. That's surely meant to be a basic functionality that shouldn't need more than the right settings.

I applied those code changes for v1.5 if you are using v1.3 then you don't need to.
Try using this module for Canadian taxes - just recently updated and works.

If you can't see the link go to: Plugins and then search for Canadian Taxes and it will come up.

This is the proper way to setup Canadian Taxes. V.1.0

Please choose the province in which you do business and run ONLY that SQL file. They have been separated and altered to be accurate as of July 1st 2012.

Either open and run in your Zen Cart Administration "Install SQL Patch" utility located under 'tools' or run in phpmyadmin.

PLEASE NOTE:

BACKUP YOUR DATABASE FIRST!

These SQL files will remove all existing taxes and zone definitions. It is assumed that you are downloading this module because your store taxes and zone definitions do not work anyway. It is purposely done this way to clean up the incorrect settings that would remain otherwise.

If you require additional zone definitions for shipping, you will need to add them in again after running this SQL file.

There is a chance that you may have set your products to a tax that may have had a different ID associated with it. In this case we have provided the below SQL statement to globally change all of your products to use the taxes that you are going to install.

So to be clear run this statement after you run your Tax setup SQL.

UPDATE##products##SET##products_tax_class_id=1;

Qdixon - Quentin Dixon
GeekHost.ca

30 Jul 2012, 3:52 PM
#297
raydube avatar

raydube

New Zenner

Join Date:
Sep 2006
Posts:
51
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Two notes Catherine.

First, in Quebec, you are still required to pay GST, so yes, Quebec does need to be included in the GST Zone.

Second, your code modificaitons states:

- open includes/classes/order.php and uncomment the if statement on line 523:
Before = if ($taxDescription == $products_tax_description)...
After = //if ($taxDescription == $products_tax_description)...
However, the "After" note shows the line commented out, rather than "uncomment" as you instructed.

Third, I agree with uniline, this is a feature that is not working correctly in the latest version of the script, so should be considered a bug.

Ray

30 Jul 2012, 3:58 PM
#298
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

RayDube:

Two notes Catherine.

First, in Quebec, you are still required to pay GST, so yes, Quebec does need to be included in the GST Zone.

Second, your code modificaitons states:

However, the "After" note shows the line commented out, rather than "uncomment" as you instructed.

Third, I agree with uniline, this is a feature that is not working correctly in the latest version of the script, so should be considered a bug.

Ray[/COLOR]

You are 100% correct - I will correct that wording - should say COMMENT OUT, not UN COMMENT.

30 Jul 2012, 4:10 PM
#299
gandalfsmith avatar

gandalfsmith

New Zenner

Join Date:
Oct 2011
Location:
Toronto Canada
Posts:
69
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

gandalfsmith:

In an earlier thread in this post I uploaded a zip file with all the settings that I used to configure the taxes for Canadian Store in Quebec - mine works as this was on version 1.5. If you read my notes (text file) - there were 2 fixes that I had to apply for version 1.5

FIXES
4A - Compound tax was not working correctly so I applied the following changes to includes/classes/order.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!

  • open includes/classes/order.php and uncomment the if statement on line 523:
    Before = if ($taxDescription == $products_tax_description)...
    After = //if ($taxDescription == $products_tax_description)...

  • and replace:
    Code:

$taxAdd = zen_calculate_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty']

  • zen_round(zen_calculate_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']), $decimals);

with this taken from v1.39:

Code:

$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)

  • zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);

FIXES
5A - Split Tax Shipping and descriptions were not working properly for Compound tax so I applied the following changes to includes/module/order_total/ot_shipping.php
REMEMBER TO ALWAYS MAKE A BACKUP OF YOUR FILES BEFORE APPLYING ANY CHANGES!

  • open include/module/order_total/ot_shipping.php and uncomment the following code on line 21:
    Before = unset($_SESSION['shipping_tax_description']);
    After = //unset($_SESSION['shipping_tax_description']);

  • on about LINE 54 look for if ($shipping_tax_basis == 'Billing') {.....

ADD THE FOLLOWING JUST ABOVE THIS - at about line 50
//Begin SplitTaxLines modification
//--------------------------------
if (SHOW_SPLIT_TAX_CHECKOUT == 'false')
{

  • on about LINE 78 look for if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);

ADD THE FOLLOWING JUST BELOW THIS - at about line 79

} else {
//split the taxes
if ($shipping_tax_basis == 'Billing') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif ($shipping_tax_basis == 'Shipping') {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
if (STORE_ZONE == $order->billing['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
} elseif (STORE_ZONE == $order->delivery['zone_id']) {
$shipping_tax = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = zen_get_multiple_tax_rates($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
} else {
$shipping_tax = 0;
}
}

//accumulate taxes from array
foreach ($shipping_tax as $tax_entry_index=>$tax_entry_value)
{
$this_shipping_tax_amount = zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$aggregate_shipping_tax_amount += $this_shipping_tax_amount;
$aggregate_shipping_tax_description += " + " . $shipping_tax_description[$tax_entry_index];
$order->info['tax_groups'][$tax_entry_index] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
$order->info['total'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += zen_calculate_tax($order->info['shipping_cost'], $tax_entry_value);
}
$order->info['shipping_tax'] += $aggregate_shipping_tax_amount;
$order->info['tax'] += $aggregate_shipping_tax_amount;
//preserve aggregate tax descriptions and amounts for session variables
$_SESSION['shipping_tax_description'] = $aggregate_shipping_tax_description;
$_SESSION['shipping_tax_amount'] = $aggregate_shipping_tax_amount;
}

***Please note that the fixes should say COMMENT OUT - not UNCOMMENT.

30 Jul 2012, 5:04 PM
#300
raydube avatar

raydube

New Zenner

Join Date:
Sep 2006
Posts:
51
Plugin Contributions:
0

Re: Configuring Taxes for Canadian Sites/Zones

Hello Catherine,

Perhaps the text attachment was a little more detailed, but the notes you've copied here cause me some concern.

First you say to comment out the if statement with regards to the tax description (After = //if ($taxDescription == $products_tax_description)...) But then ask us to edit the contents of that if statement (which we just commented out)

I haven't reviewed any further, thought maybe I was missing something.

Of course, I'd like to know where the formula for the tax calculation is, to see if there is a difference in that function between 1.3.9 and 1.5 to see if there the reason for the changes between the two versions, as I'm starting to think that there is where the change should be made.

Ray