cart icon indicating copy to clipboard operation
cart copied to clipboard

Shipping cost wrong

Open matin73 opened this issue 3 years ago • 1 comments

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

matin73 avatar Nov 20 '21 10:11 matin73

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);

}); `

matin73 avatar Nov 20 '21 17:11 matin73

@extcode I had the same issue still in 9.x-dev and will make a PR for it.

rintisch avatar Mar 19 '24 20:03 rintisch