cart
cart copied to clipboard
Shipping cost wrong
If I add different shipping cost for different countries, the rates are wrong resetet if you first select country - than click "An die gleiche Adresse versenden. " twice (activate, disable). Shipping cost is now reset to default country.
For example: shipping cost to germany € 5,00, shipping cost to england €10,00. Now add item to cart and got to cart. Add name and address and select "England" for invoice country. shipping cost are correct set from € 5,00 to € 10,00. but not click " An die gleiche Adresse versenden. " and shipping costs are reset to € 5,00 for default country, because the default country is selected for shipping country. click again " An die gleiche Adresse versenden. " to disable extra shipping address and use invoice address for shipping too.
Shipping costs are NOT set to € 10,00 for england which is still selected for invoice address. And user can order with wrong shipping costs.
Martin
I think I could solve is by adding "var shippingCountry = billingCountry;" in "else condition": `$("#shipping-same-as-billing").change(function() { $("#checkout-step-shipping-address").toggle(!this.checked);
var billingCountry = $("#billingAddress-country").val();
var shippingCountry = $("#shippingAddress-country").val();
if(!$("#shipping-same-as-billing").is(":checked")) {
$("#checkout-step-shipping-address input, #checkout-step-shipping-address select").each(function() {
if($(this).data("disable-shipping")) {
$(this).prop("disabled", false);
}
});
} else {
var shippingCountry = billingCountry;
$("#checkout-step-shipping-address input, #checkout-step-shipping-address select").each(function() {
if($(this).data("disable-shipping")) {
$(this).prop("disabled", true);
}
});
}
updateCountry(billingCountry, shippingCountry);
}); `
@extcode I had the same issue still in 9.x-dev and will make a PR for it.