I have a problem with Zen-Cart, the original developer hacked a lot of core modules, and I do not want to repeat this, in order to be able to upgrade. If this is not something that will be supported in any way, I would like to know right now.
Thank you very much for your time!
Yes, 33¢ on $100 purchase and the current way taxes are calculated is not a big deal. But there's an issue of ethics and ensuring the product of a fully functional and legal web site I build for a client is correct.
With the way the government is getting about collecting taxes and everything up to the letter of the law, it would not surprise me if they start to audit web sites and tax business operators through fines for not having calculations 100% accurate.
Work-arounds of mark-ups to cover deficiencies in code are unacceptable.
Example:
in catalog / model / total / tax.php
Code: Select all
<?php
class ModelTotalTax extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
foreach ($taxes as $key => $value) {
if ($value > 0) {
$total_data[] = array(
'code' => 'tax',
'title' => $this->tax->getRateName($key),
'text' => $this->currency->format($value),
'value' => $value,
'sort_order' => $this->config->get('tax_sort_order')
);
$total += $value;
}
}
}
}
?>
Code: Select all
<?php
class ModelTotalTax extends Model {
public function getTotal(&$total_data, &$total, &$taxes) {
foreach ($taxes as $key => $value) {
if ($value > 0) {
$total_data[] = array(
'code' => 'tax',
'title' => $this->tax->getRateName($key),
'text' => $this->currency->format($value),
'value' => $value,
'sort_order' => $this->config->get('tax_sort_order')
);
$total += $value;
}
}
$cumulative = round(($this->cart->getTotal() * 0.095), $this->currency->getDecimalPlace());
$total_data[] = array(
'code' => 'tax',
'title' => 'QST (9.5%)',
'text' => $this->currency->format($cumulative),
'value' => $cumulative,
'sort_order' => $this->config->get('tax_sort_order')
);
$total += $cumulative;
}
}
?>
Simply change 'QST (9.5%)' to the name of your tax, and 0.095 to the tax rate. (decimal form, not percentage)
*Edit: Updated rate to 9.5% to match the current Quebec QST rate)*
Regards,
Joel.
Thank you for posting this modification. This will also be practical for Quebec taxes calculation purposes. Although, since this month in Canada, taxes has increased so: 0.075 would no longer be true unfortunately. :/
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks for letting me know. I've updated the rate to 9.5% to match Quebec's current QST rate.
In Ontario we now have the wonderful HST, which means we avoid the cumulative tax, but also means we are charged taxes on items that used to be exempt from one tax or the other.
Joel.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
this:
Code: Select all
$cumulative = round(($this->cart->getTotal()* 0.095), $this->currency->getDecimalPlace());
Code: Select all
$cumulative = round(($total * 0.095), $this->currency->getDecimalPlace());
I'll have a look and see how involved it would be to add a simple compound tax feature to opencart based off of a single boolean to mark a tax as being taxable and on a tax order integer value.
I haven't checked the opencart code before but it should be a rather simple mod.
Thanks Joel for the code!
Solutions I.D.S.
Alain Gaudreau
Propriétaire/Consultant
http://www.solutionsids.ca
Vente et réparation d'ordinateur de maison, portable, serveurs, pièces et logiciels
Administration de systèmes UNIX (Sun, BSD) et Linux
Conception de logiciels et Programmation (Java, C, C++, C#, PHP, PIC32 C/ASM)
Hébergement de serveurs et de site web
I have implemented the compound tax feature in opencart.
What is the preferred method to post or submit a modification which involves 4-5 core files and adding a field to one of the database tables so that it will be as pain free as possible for less technical people to implement?
Should I create a vqmod for it or a simple diff based patch file and instructions on the command for mysql to alter the right table?
Solutions I.D.S.
Alain Gaudreau
Propriétaire/Consultant
http://www.solutionsids.ca
Vente et réparation d'ordinateur de maison, portable, serveurs, pièces et logiciels
Administration de systèmes UNIX (Sun, BSD) et Linux
Conception de logiciels et Programmation (Java, C, C++, C#, PHP, PIC32 C/ASM)
Hébergement de serveurs et de site web
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Le voici / Here you go.josee225 wrote:Could you please let us know when the vqmod is ready? I can't wait to use this one! Thanks! Merci!
Remember to revert the changes from the original file above before using this XML.
Attachments
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester

Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Is this mod the same that agaudreau talked about or its a diffrent one?
Thx
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
** EDITED **
Looks like this doesn't pertain to me. I'm setting up a shopping cart for a client in Ontario and I'm working on setting up the tax rates. Any suggestion on what to put for Quebec & PEI so it calculates properly?
Taxes make my head hurt almost as much as IE quirks.
You can view it here: http://www.opencart.com/index.php?route ... on_id=5976
Increase Page Speed (#1 rated commercial extension on OpenCart Marketplace)
15in1 Essential Extensions Value Pack Premium Customer Testimonials Reward Points Extended Admin Security Lockdown Suite
irc.freenode.net #opencart
Users browsing this forum: No registered users and 96 guests