woocommerce/templates/myaccount/form-edit-address.php

45 lines
1.1 KiB
PHP
Raw Normal View History

<?php
/**
2012-08-14 18:05:45 +00:00
* Edit address form
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
2012-08-14 18:05:45 +00:00
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $woocommerce, $current_user;
$page_title = ( $load_address == 'billing' ) ? __( 'Billing Address', 'woocommerce' ) : __( 'Shipping Address', 'woocommerce' );
get_currentuserinfo();
?>
2013-06-11 14:59:54 +00:00
<?php wc_print_messages(); ?>
<?php if ( ! $load_address ) : ?>
2012-02-22 21:06:08 +00:00
<?php woocommerce_get_template( 'myaccount/my-address.php' ); ?>
2012-02-22 21:06:08 +00:00
<?php else : ?>
<form method="post">
2012-08-14 18:05:45 +00:00
<h3><?php echo apply_filters( 'woocommerce_my_account_edit_address_title', $page_title ); ?></h3>
2012-08-14 18:05:45 +00:00
<?php foreach ( $address as $key => $field ) : ?>
2012-08-14 18:05:45 +00:00
<?php woocommerce_form_field( $key, $field, ! empty( $_POST[ $key ] ) ? woocommerce_clean( $_POST[ $key ] ) : $field['value'] ); ?>
2012-08-14 18:05:45 +00:00
<?php endforeach; ?>
2012-08-14 18:05:45 +00:00
2012-12-23 12:19:56 +00:00
<p>
<input type="submit" class="button" name="save_address" value="<?php _e( 'Save Address', 'woocommerce' ); ?>" />
2013-06-11 16:55:55 +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>
2012-02-22 21:06:08 +00:00
<?php endif; ?>