Delivery/Shipping Address not Saving in Woocommerce
-
The delivery/shipping address entered into Distance Calculator Fields is not inserting into the order – please advise/arrange fix – this is crucial to our business
-
I do not have shipping enabled as all my ‘products’ are rentals and every rental requires the shipping distance to be calculated. If I enable shipping on my rentals the checkout page ends up with two delivery address sections
The delivery_address meta is saving it’s just not populating the correct WooCommerce Fields for invoicing purposes
The address is indeed in the order meta but it should be updating the order correctly – the address does not save in the correct fields. I cannot have delivery enabled as otherwise I end up with two delivery address fields in the checkout
If enable shipping for products or rentals in Woocommerce I end up with two fields? What am I doing incorrectly to use your plugin and it update the delivery address field properly?
-
This reply was modified 1 year ago by
ajc2023.
Hi!
Plugin has nothing to do with the extra fields.. you can always disable the delivery fields from woocommerceYour plugin should update the delivery address in Woocommerce – surely? And yes I am aware I can disable the Woocommerce fields which I have been doing, but your plugin does not update the order shipping address in Woocommerce and a single line text for an address when a customer is placing an order is not easily manipulated as each part of the address is not separated by a comma or any other character to allow a custom script to be written to update these fields
Please advise how I can get your plugin to update the following fields in Woocommerce:
_shipping_address_1
_shipping_address_2
_shipping_city
_shipping_country
_shipping_postcode
your delivery_address meta field does not separate the address entered via the calculator to allow manipulation of it. It simply enters a space separated single line of all fields. If it was separated by a comma or another character it could be manipulated
Therefore please advise how I can use the data stored in delivery_address for it to be usable by my client
I’m not Sure what you are talking about.. like updating the address in woocommerce fields.. like it is updating/storing the address in woocommerce orders.. but you can use the address with this piece of code
$date = $order->get_meta('custom_date_picker'); $time = $order->get_meta('custom_time_picker'); $address = $order->get_meta('delivery_address');
OK I’ll try and explain a little better
Image 1: The Distance Calculator captures the address in the form and after your update following my ticket yesterday, it now calculates the correct price and adds it to the order
Image 2: The Shipping Address captured in Distance Calculator does not transfer from the checkout to the shipping address in the backend
Image 3: The delivery address does not show in new order or customer invoice emails to customer/or Shop Manager
Image 4: The delivery address does not show in pdf invoice attached to all emails to both customer and shop manager
Image 5: Yes, the custom field delivery_address has updated with a single line address but how do I get the address either from the delivery_address field or directly from ‘custom_address’, ‘cm_town/city’, ‘cm_fe_country’, ‘cm_fe_postcode’ fields to populate the Woocommerce Shipping Fields so that the Shop Manager can see where the order is to be shipped to and the customer can see the delivery address in their order confirmation? My clients are not tech savy and do not want to be having to manually update the shipping address on every order. I’m clearly missing something but cannot see what?
Using $order->update_meta_data( ‘_shipping_address_1’, sanitize_text_field($_POST[‘custom_address’]) ); etc does not work
Using the following does not work because the Distance Calculator form fields are not stored in the wordpress database. The only address which is stored is the delivery_address but as this is a single line I cannot get it to populate the correct Woocommerce/Wordpress shipping fields
global $wpdb;
$table = $wpdb->prefix . ‘postmeta’;
$shipping_address_1 = array (‘post_id’ => $order->, ‘meta_key’ => ‘_shipping_address_1’, ‘meta_value’ => $_POST[‘custom_address’]);
$wpdb->insert( $table, $shipping_address_1); -
This reply was modified 1 year ago by
- The topic ‘Delivery/Shipping Address not Saving in Woocommerce’ is closed to new replies.