$customer_session = WC()->session->get( 'customer' ) WC_session: set customer billing and shipping country $country_code = WC()->customer->get_shipping_country() $country_code = WC()->customer->get_billing_country() This can be done with the following: # Get the geolocated customer country code *(if enabled)*: Then you will need to update the customer country in WC()->session and in WC()->customer objects. ![]() You should need to get the customer location or shipping zone first. But this should be your work.ġ) Customer location (for shipping Zones): ![]() Now the correct way to set shipping data on product page, is to use Ajax to update the data, as the action is made by the customer on client side (browser), avoiding 'post' and reload the page. ![]() So I can answer partially as you should need to make some work yourself, and ask later more specific questions…
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |