https://nickorigami.com/my-account/edit-address/
It shows the Account Summary page, but no address. I’m using woo 8.6.1. and on another site, the address does appear. Any clues? I’ve not edited any templates.
]]>On my checkout I have a checkbox “Do you want an invoice?”, if the user select that checkbox your plugin loads some additional fields, some of them are required.
Everything works perfectly, BUT if the user tries to edit his address from his WooCommerce “My Account” page, the additional fields that are supposed to be required only for who check the “Do you want an invoice?” checkbox are now mandatory for everyone.
Is it a bug? Should i set something differently for the “my account” page?
]]>add_action( “woocommerce_after_edit_address_form_billing”, ‘action_woocommerce_after_edit_address_form_load_address’, 10, 0 );
function action_woocommerce_after_edit_address_form_load_address () { ?>
<div class=”woocommerce-address-fields”>
<?php
$current_user_id = get_current_user_id();
$admin_order_state_id = get_user_meta( $current_user_id, ‘billing_custom_state’, true );
global $wpdb;
//echo'<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js”></script>’;
$aStates = $wpdb->get_results( “select * from wp_posts where post_status = ‘publish’ AND post_type=’location’ order by ID desc”);
?>
<label for=”billing_custom_state”><?php esc_html_e( ‘if you what to change the pickup address? Please choose the address below:’, ‘woocommerce’ ); ?> <span class=”required”>*</span></label>
<span class=”woocommerce-input-wrapper”>
<p class=”avada-select-parent”>
<!– <div class=”select_mate” data-mate-select=”active” > –>
<select name=”billing_custom_state” id=”billing_custom_state” class=”states form-row” onchange=”” onclick=”return false;”>
<option value=””>–Select State–</option>
<?php
foreach ($aStates as $state)
{
$billing_state = $wpdb->get_results( “select * from wp_posts where ID = ‘”.$admin_order_state_id.”‘ AND post_status = ‘publish’ AND post_type=’location'”);
foreach ($billing_state as $billing_state_value)
{
?>
<option value=”<?php echo $state->ID;?>”><?php echo $state->post_title; ?></option>
<?php } } ?>
</select>
<span class=”select-arrow”></span>
</p>
</span>
</div>
<?php }
for update custom address field into database
/**
* Update the user meta with field value
**/
add_action( ‘woocommerce_customer_save_address’, ‘action_woocommerce_customer_save_address’, 10, 2 );
//$load_address = ‘billing’;
function action_woocommerce_customer_save_address($user_id, $load_address) {
$order_state_id = get_user_meta( $user_id, ‘billing_custom_state’, true );
$order_city_id = get_user_meta( $user_id, ‘billing_custom_city’, true );
$order_location_id = get_user_meta( $user_id, ‘billing_custom_location’, true );
update_user_meta( $user_id, ‘billing_custom_state’, esc_attr($_POST[‘billing_custom_state’]), $order_state_id );
update_user_meta( $user_id, ‘billing_custom_city’, esc_attr($_POST[‘billing_custom_city’]), $order_city_id );
update_user_meta( $user_id, ‘billing_custom_location’, esc_attr($_POST[‘billing_custom_location’]), $order_location_id );
//update_post_meta( $post_id, ‘_billing_custom_state’, esc_attr($_POST[‘billing_custom_state’]), $order_state_id );*/
$current_user_id = get_current_user_id();
$customer_meta = get_user_meta( $current_user_id );
$customer_orders = get_posts( array(
‘numberposts’ => -1,
‘meta_key’ => ‘_customer_user’,
‘meta_value’ => $current_user_id,
‘post_type’ => wc_get_order_types(), //shop_order
‘post_status’ => array_keys( wc_get_order_statuses() ) //wc-processing
) );
foreach( $customer_orders as $order ) {
update_post_meta( $order->ID, ‘_billing_custom_state’, esc_attr($_POST[‘billing_custom_state’]), $customer_meta[‘billing_custom_state’][0] );
update_post_meta( $order->ID, ‘_billing_custom_city’, esc_attr($_POST[‘billing_custom_city’]), $customer_meta[‘billing_custom_city’][0] );
update_post_meta( $order->ID, ‘_billing_custom_location’, esc_attr($_POST[‘billing_custom_location’]), $customer_meta[‘billing_custom_location’][0] );
}
}
using above hook i cant able to update the value kindly review my code and support me.
]]>“Billing address” and the list below are not displayed correctly.
]]>I searched and tried various hooks but none of them seem to work as intended.
Thank you
]]>When I am on the page to edit an order, I click on the small pencil icon either near either the Shipping or Billing Address. What used to happen is that a window would pop up where I could change the address. Now nothing happens, and I have no way of adding a new customer address so as not to forget it.
### STEPS TO REPRODUCE THE ISSUE
Click on WooCommerce in WordPress Admin side dash bar
Click on Orders
Click on a specific order number in order to open edit page
Click on the “pencil” icon near the customers billing or shipping address.
At this point, nothing happens for me. When I hover over the pencil, this is the URL that shows: https://hiddendoorstore.com/wp-admin/post.php?post=1294&action=edit#
Please help!
]]>I’m having problems with some woocommerce features since when I go in my-account webpage, the links edit-account
and edit-address
do not exist.
Do I need to write my own code to enable users to change their address or to change their account details, or is there any function which I can use to do this?
Why these pages are not included in Woocommerce plugin?
This is screenshot which shows my Accounts configurations with all the end-point links. Any of these pages exist at this moment.
]]>