Problem with getCustomerLocation and get_delivery_location
-
Hi,
I’m having an issue retrieving pickup points on my client’s site.
When a customer registers using Google, their cart has blank address fields. Later, when the customer fills in their address, the
getCustomerLocationfunction is triggered as expected, but it still returns empty values because the condition uses&&instead of||.To fix this, I changed the condition to use
||, so the values are retrieved correctly:let street1 = $('#shipping_address_1').val() || $('#billing_address_1').val();
let street2 = $('#shipping_address_2').val() || $('#billing_address_2').val();
let city = $('#shipping_city').val() || $('#billing_city').val();I suggest moving the
get_delivery_locationAJAX call into a separate function (e.g.,getDeliveryLocation) so it can be reused and triggered at different points in the system, such as withinchangeShipping. This adjustment would ensure pickup points are properly loaded not only on page load, but also when selecting Cargo Shipping. Would it be possible to implement this change?Thanks
The topic ‘Problem with getCustomerLocation and get_delivery_location’ is closed to new replies.