Wrong country is used for shipping costs calculation

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:patch (needs review)
Description
Project: 
Ubercart

I have imported all countries into the system, and set my store location to Canada.

Calculating shipping costs sends wrong country to the server:
1) If I select a country that appears in the list BEFORE Canada, it send the right country
2) If I select a country that appear in the list AFTER Canada, it is ignored and Canada is sent to the server as the delivery country.

The error comes from the js code of uc_quote, and the following patch fixes it for me:

--- uc_quote.js.orig    2007-10-14 21:59:31.000000000 +0200
+++ uc_quote.js 2007-10-14 21:59:42.000000000 +0200
@@ -29,7 +29,7 @@ function quoteCallback(products){
   //details["details[zone]"] = $("select[@name*=delivery_zone] option:selected").val();
   //details["details[country]"] = $("select[@name*=delivery_country] option:selected").val();
   $("select[@name*=delivery]").each(function(i){
-    details["details[" + $(this).attr("name").split("delivery_")[1].replace(/]/, "") + "]"] = $(this).children("option:selected").val();
+    details["details[" + $(this).attr("name").split("delivery_")[1].replace(/]/, "") + "]"] = $(this).val();
   });
   $("input[@name*=delivery_]").each(function(i){
     details["details[" + $(this).attr("name").split("delivery_")[1].replace(/]/, "") + "]"] = $(this).val();
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
See more information in this

See more information in this thread, respond through this issue.