| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
When the checkout page is loaded, taxes are calcualted correctly.
If there exist a tax line at this phase, it will not be deleted.
Then I change something that do not have a tax inovlved (e.g. I change to a different country, for which there are no tax rules). I click on 'calculate shipping' and taxes are left as they were - the tax line does not get deleted, although the taxes do not apply to this new country.
I have made a TEMPORAL ugly patch, that solves it in my case. I provide it here for the developer to understand where the problem lies, but this is not a solution, as you can see from the code.
--- uc_taxes.orig.js 2007-10-17 10:24:25.000000000 +0200
+++ uc_taxes.js 2007-10-17 10:26:27.000000000 +0200
@@ -15,7 +15,7 @@ $(document).ready(function(){
});
function getTax(){
- var zone = $("select[@name*=" + pane + "_zone] option:selected").val();
+ var zone = $("select[@name*=" + pane + "_zone]").val();
if (!zone){
zone = "0";
}
@@ -23,7 +23,7 @@ function getTax(){
if (!code){
code = '';
}
- var country = $("select[@name*=" + pane + "_country] option:selected").val();
+ var country = $("select[@name*=" + pane + "_country]").val();
if (!country){
country = "0";
}
@@ -51,8 +51,13 @@ function getTax(){
success: function(taxes){
//if (taxes.constructor == Array){
var j;
+ var has_tax=false;
for (j in taxes){
set_line_item("tax_" + taxes[j].id, taxes[j].name, taxes[j].amount, tax_weight + taxes[j].weight / 10);
+ has_tax=true;
+ }
+ if (!has_tax) {
+ set_line_item("tax_1", 'Tax', 0, 8);
}
//}
}


