2011-12-09 17:01:56 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-11-03 13:53:50 +00:00
|
|
|
* Edit address form
|
2012-08-14 18:05:45 +00:00
|
|
|
*
|
2015-11-03 13:31:20 +00:00
|
|
|
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/form-edit-address.php.
|
2015-10-01 14:07:20 +00:00
|
|
|
*
|
2016-02-12 11:28:41 +00:00
|
|
|
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
|
|
|
* (the theme developer) will need to copy the new files to your theme to
|
|
|
|
* maintain compatibility. We try to do this as little as possible, but it does
|
|
|
|
* happen. When this occurs the version of the template file will be bumped and
|
|
|
|
* the readme will list any important changes.
|
2015-10-01 14:07:20 +00:00
|
|
|
*
|
2016-07-19 10:30:31 +00:00
|
|
|
* @see https://docs.woocommerce.com/document/template-structure/
|
2016-01-15 20:34:37 +00:00
|
|
|
* @author WooThemes
|
|
|
|
* @package WooCommerce/Templates
|
2017-11-07 10:14:05 +00:00
|
|
|
* @version 3.3.0
|
2011-12-09 17:01:56 +00:00
|
|
|
*/
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2014-04-23 10:35:43 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2016-02-16 16:11:50 +00:00
|
|
|
exit;
|
2014-04-23 10:35:43 +00:00
|
|
|
}
|
2012-10-15 10:57:58 +00:00
|
|
|
|
2016-10-12 10:16:30 +00:00
|
|
|
$page_title = ( 'billing' === $load_address ) ? __( 'Billing address', 'woocommerce' ) : __( 'Shipping address', 'woocommerce' );
|
2011-12-09 17:01:56 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
do_action( 'woocommerce_before_edit_account_address_form' ); ?>
|
2011-12-09 17:01:56 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
<?php if ( ! $load_address ) : ?>
|
|
|
|
<?php wc_get_template( 'myaccount/my-address.php' ); ?>
|
|
|
|
<?php else : ?>
|
2012-02-22 21:06:08 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
<form method="post">
|
2012-02-22 21:06:08 +00:00
|
|
|
|
2017-11-07 10:14:05 +00:00
|
|
|
<h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title, $load_address ); ?></h3><?php // @codingStandardsIgnoreLine ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2016-12-12 15:23:28 +00:00
|
|
|
<div class="woocommerce-address-fields">
|
|
|
|
<?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2017-03-02 15:08:02 +00:00
|
|
|
<div class="woocommerce-address-fields__field-wrapper">
|
2017-06-16 10:45:53 +00:00
|
|
|
<?php
|
2017-11-07 10:14:05 +00:00
|
|
|
foreach ( $address as $key => $field ) {
|
|
|
|
if ( isset( $field['country_field'], $address[ $field['country_field'] ] ) ) {
|
|
|
|
$field['country'] = wc_get_post_data_by_key( $field['country_field'], $address[ $field['country_field'] ]['value'] );
|
2017-06-16 10:45:53 +00:00
|
|
|
}
|
2017-11-07 10:14:05 +00:00
|
|
|
woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
|
|
|
|
}
|
2017-06-16 10:45:53 +00:00
|
|
|
?>
|
2017-03-02 15:08:02 +00:00
|
|
|
</div>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2016-12-12 15:23:28 +00:00
|
|
|
<?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?>
|
2014-09-22 16:31:03 +00:00
|
|
|
|
2016-12-12 15:23:28 +00:00
|
|
|
<p>
|
2017-11-07 10:15:00 +00:00
|
|
|
<button type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save address', 'woocommerce' ); ?>"><?php esc_html_e( 'Save address', 'woocommerce' ); ?></button>
|
2016-12-12 15:23:28 +00:00
|
|
|
<?php wp_nonce_field( 'woocommerce-edit_address' ); ?>
|
|
|
|
<input type="hidden" name="action" value="edit_address" />
|
|
|
|
</p>
|
|
|
|
</div>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
</form>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
<?php endif; ?>
|
2016-05-23 19:47:50 +00:00
|
|
|
|
2016-06-06 11:05:37 +00:00
|
|
|
<?php do_action( 'woocommerce_after_edit_account_address_form' ); ?>
|