Canada has cumulative taxes in some states.
Structure of tax is
Quebec GST= 5%
PST = 7.5%
IMPORTANT>>* in Québec, PST is calculated on the total price including GST
that means for Quebec:
TaxwithGST = price +GST
Total tax = TaxwithGST + PST of TaxwithGST
How to implement taxes in Quebec where taxes are cumulative?
Is it possible to do in Open cart.
Because I have been trying it for past 2 days.
Structure of tax is
Quebec GST= 5%
PST = 7.5%
IMPORTANT>>* in Québec, PST is calculated on the total price including GST
that means for Quebec:
TaxwithGST = price +GST
Total tax = TaxwithGST + PST of TaxwithGST
How to implement taxes in Quebec where taxes are cumulative?
Is it possible to do in Open cart.
Because I have been trying it for past 2 days.
Hi Daniel !
I also have to do this cummulative tax things. The way opencart calculate taxes is :
So a 100$ item would end up as 112.50 $ which is wrong here in quebec, we should do cummulative tax :
The correct amount would be 112.88 $
Any way to do it simply or hard coding is the only way ?
Thanks for your time
I also have to do this cummulative tax things. The way opencart calculate taxes is :
Code: Select all
base price
+
base price * tax1 (5%)
+
base price * tax2 (7.5%)
Code: Select all
base price
+
base price * tax1 (5%)
+
(base price + (base price * tax1 (5%))) * tax2 (7.5%)
Any way to do it simply or hard coding is the only way ?
Thanks for your time

I understand 33 cents is no big deal on a 100 $ item. But as your raise the base price (or the quantity), it becomes bigger and bigger. And for the sake of doing things correctly, it is just not an option to leave it this way.
Maybe if someone could just point up what file/module is doing the tax calculation, I will gladly change it and repost the modification I made in my site.
Thanks
Maybe if someone could just point up what file/module is doing the tax calculation, I will gladly change it and repost the modification I made in my site.
Thanks
Allright, I managed to get this done the "correct way" I guess. I finally crafted an Extension for Orders Total. I simply disabled the default Taxes module. The new one recalculates taxes cumulatively. The only part where it does not work is for prices when browsing for items. I just configured "Display Prices With Tax: NO" and all seems fine.
I will be posting the contribution in a few days with appropriate docs.for fellow Canadians that would need this handy add-on. This gave me a good challenge and made me learn more about the internal structure of opencart, a very nice piece of software. Thumbs up to the developpers.
I will be posting the contribution in a few days with appropriate docs.for fellow Canadians that would need this handy add-on. This gave me a good challenge and made me learn more about the internal structure of opencart, a very nice piece of software. Thumbs up to the developpers.

Hi Daniel,
I know is weird.
base price
+
base price * tax1(priority1) (5%)
+
(base price + (base price * tax1(priority1) (5%))) * tax2(priority2) (7.5%)
Prestashop dont offert this possibility. It's hard to find a web 2.0 shopping cart with cumulative tax.
Thx
Sol
I know is weird.

base price
+
base price * tax1(priority1) (5%)
+
(base price + (base price * tax1(priority1) (5%))) * tax2(priority2) (7.5%)
Prestashop dont offert this possibility. It's hard to find a web 2.0 shopping cart with cumulative tax.
Thx
Sol
Attachments
tax.png (9.97 KiB) Viewed 8538 times
Last edited by sol on Fri Nov 20, 2009 10:03 am, edited 1 time in total.
Is not weird.....this is the way to calculate TAXES in Quebec. I think is not hard to change the code. Lets go to work together in this. Thanks.
My uncle live in Canada told me that there are really cumulative tax in some state of Canada including their state. Honestly speaking, I don't know what is that cumulative tax for? Maybe that tax has a great advantages on us especially the poor ones. I hope you and ax Attorney could help me.
Hi Daniel / open cart developers / module developers,
I've done an analysis of the source code and noted that the "cumulative taxes" requirement could be implemented by amending the getRate() and calculate() functions in system/library/tax.php file.
Currently, the system sums up all tax rates of a particular tax class with getRate(), and does the multiplication with the product price with calculate() and divides by 100 to find the product after-tax total as shown below:
For reference, here's the code responsible for computing the after-tax total (in system/library/tax.php):
My problem is that I suspect files in the system/library/ folder are core files that shouldn't be modified directly.
Does opencart provide a way to override the getRate() and calculate() functions with custom ones through a module/extension, thus keeping the core files intact as well as the possibility of reverting back?
If not, what would be the best way to implement this cumulative taxes requirement into opencart, knowing that functionality must change at the system/library/tax.php level.
Thank you,
Wadih
I've done an analysis of the source code and noted that the "cumulative taxes" requirement could be implemented by amending the getRate() and calculate() functions in system/library/tax.php file.
Currently, the system sums up all tax rates of a particular tax class with getRate(), and does the multiplication with the product price with calculate() and divides by 100 to find the product after-tax total as shown below:
For reference, here's the code responsible for computing the after-tax total (in system/library/tax.php):
Code: Select all
public function calculate($value, $tax_class_id, $calculate = TRUE) {
if (($calculate) && (isset($this->taxes[$tax_class_id]))) {
$rate = $this->getRate($tax_class_id);
return $value + ($value * $rate / 100);
} else {
return $value;
}
}
public function getRate($tax_class_id) {
if (isset($this->taxes[$tax_class_id])) {
$rate = 0;
foreach ($this->taxes[$tax_class_id] as $tax_rate) {
$rate += $tax_rate['rate'];
}
return $rate;
} else {
return 0;
}
}
Does opencart provide a way to override the getRate() and calculate() functions with custom ones through a module/extension, thus keeping the core files intact as well as the possibility of reverting back?
If not, what would be the best way to implement this cumulative taxes requirement into opencart, knowing that functionality must change at the system/library/tax.php level.
Thank you,
Wadih
This is actually called a "Compound" tax. IMO this should be a property that admins should be able to activate on a tax, most other shopping carts already support this. Using the effective tax rate is a temporary solution, but is sure to increase cart abandonment rates and support costs for high-volume stores.
I have managed to extract the php files I created/modified/hacked to get these cumulative taxes to work.
Edit : Back in oct 2009... open cart 1.3.2 at that time
I do have those files handy if needed... You might have to make them fit in the new versions but at least they have done the job. PM me if you need those.
Regards
Francis
Edit : Back in oct 2009... open cart 1.3.2 at that time
I do have those files handy if needed... You might have to make them fit in the new versions but at least they have done the job. PM me if you need those.
Regards
Francis
Who is online
Users browsing this forum: Majestic-12 [Bot] and 78 guests