Hi - I have an odd problem turn up when using some javascript in the checkout to update the shipping costs. I have an overload statement -
FC.checkout.overload("updatePrice", "updateMyShippingCost", null);
to recalculate the shipping costs based on the destination country of the shipment and whether or not there is gift wrapping involved. The function that does the recalculation looks like this -
function updateMyShippingCost() {
var numProducts = fc_json.product_count;
var basePrice = euro_uk_base;
var increment = euro_uk_increment;
var country_code = (jQuery("#use_different_addresses").is(":checked") ? $("#shipping_country").val() : $("#customer_country").val());
if (country_code != "GB") {
basePrice = euro_elsewhere_base;
increment = euro_elsewhere_increment;
}
shippingCost = basePrice + (numProducts - 1) * increment;
if (jQuery("#gift_wrap").is(":checked")) { shippingCost = shippingCost + euro_gift_wrap; }
FC.checkout.config.orderFlatRateShipping = shippingCost;
}
This works perfectly on desktop browsers but doesn't seem to work on either safari or chrome on an iphone. I tried putting in a little alert(country_code) statement and it was always set to GB regardless what was set in either the shipping_country or customer_country fields.
It's hard to see what's going on because it's only on the iphone I've seen this (I haven't tried any other mobile/smartphone devices because I don't have easy access to them). I know it's a slightly obscure problem but has anyone come up against anything similar?
regards,
Gordon
Could you link us to your store to see this in action? Feel free to whisper it if it's private.
Testing this on my iPhone - the shipping rate was changing as I changed my country from the UK to Australia, and also checking and unchecking the gift wrapping checkbox.
Are you still seeing it not working?
Just to clarify, when you say this:
Are you referring to the company field, or the country field, and if the latter do you mean that you type out the whole country name and then tap onto the next field, without interacting with the autosuggested results?
Ah yep, I'm seeing that now.
This comes down to our old autocompleter, which unfortunately we won't be making any changes to at this point. I'd strongly suggest upgrading to 1.1 (1.0 at least) and make use of the new foxycomplete included with that - it will work much nicer in general - and play nice with mobile as well.