2011-12-09 17:01:56 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2012-08-14 18:05:45 +00:00
|
|
|
* Edit address form
|
|
|
|
*
|
2015-10-03 07:58:08 +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
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @see http://docs.woothemes.com/document/template-structure/
|
2014-08-09 00:23:55 +00:00
|
|
|
* @author WooThemes
|
|
|
|
* @package WooCommerce/Templates
|
2013-09-19 13:39:49 +00:00
|
|
|
* @version 2.1.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' ) ) {
|
2014-09-22 16:31:03 +00:00
|
|
|
exit; // Exit if accessed directly
|
2014-04-23 10:35:43 +00:00
|
|
|
}
|
2012-10-15 10:57:58 +00:00
|
|
|
|
2014-04-23 10:35:43 +00:00
|
|
|
global $current_user;
|
2012-02-27 18:47:31 +00:00
|
|
|
|
2014-04-08 02:29:39 +00:00
|
|
|
$page_title = ( $load_address === 'billing' ) ? __( 'Billing Address', 'woocommerce' ) : __( 'Shipping Address', 'woocommerce' );
|
2013-09-17 09:14:48 +00:00
|
|
|
|
2012-02-27 18:47:31 +00:00
|
|
|
get_currentuserinfo();
|
2014-09-22 16:31:03 +00:00
|
|
|
|
2011-12-09 17:01:56 +00:00
|
|
|
?>
|
|
|
|
|
2013-11-13 04:34:55 +00:00
|
|
|
<?php wc_print_notices(); ?>
|
2011-12-09 17:01:56 +00:00
|
|
|
|
2013-09-19 13:39:49 +00:00
|
|
|
<?php if ( ! $load_address ) : ?>
|
2012-02-22 21:06:08 +00:00
|
|
|
|
2013-11-25 12:45:04 +00:00
|
|
|
<?php wc_get_template( 'myaccount/my-address.php' ); ?>
|
2012-02-22 21:06:08 +00:00
|
|
|
|
|
|
|
<?php else : ?>
|
|
|
|
|
2013-07-23 16:05:01 +00:00
|
|
|
<form method="post">
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-09-17 09:14:48 +00:00
|
|
|
<h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title ); ?></h3>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2014-08-09 00:35:12 +00:00
|
|
|
<?php do_action( "woocommerce_before_edit_address_form_{$load_address}" ); ?>
|
2014-08-09 00:23:55 +00:00
|
|
|
|
2013-09-19 13:39:49 +00:00
|
|
|
<?php foreach ( $address as $key => $field ) : ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
<?php woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? wc_clean( $_POST[ $key ] ) : $field['value'] ); ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2013-09-19 13:39:49 +00:00
|
|
|
<?php endforeach; ?>
|
2014-09-22 16:31:03 +00:00
|
|
|
|
2014-08-09 00:35:12 +00:00
|
|
|
<?php do_action( "woocommerce_after_edit_address_form_{$load_address}" ); ?>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2012-12-23 12:19:56 +00:00
|
|
|
<p>
|
2015-08-05 16:51:44 +00:00
|
|
|
<input type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save Address', 'woocommerce' ); ?>" />
|
2013-12-07 18:49:53 +00:00
|
|
|
<?php wp_nonce_field( 'woocommerce-edit_address' ); ?>
|
2012-12-23 12:19:56 +00:00
|
|
|
<input type="hidden" name="action" value="edit_address" />
|
|
|
|
</p>
|
2012-08-14 18:05:45 +00:00
|
|
|
|
2012-02-22 21:06:08 +00:00
|
|
|
</form>
|
2011-12-09 17:01:56 +00:00
|
|
|
|
2014-08-09 00:23:55 +00:00
|
|
|
<?php endif; ?>
|