My account remembers post data upon error

This commit is contained in:
Mike Jolley 2012-02-27 18:47:31 +00:00
parent a2714544a4
commit 59c7ca1189
2 changed files with 7 additions and 2 deletions

View File

@ -190,6 +190,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* More reliable un-force https code
* Reset link for variations
* Better grouped price code
* My account remembers post data upon error
* Hidden shipping address from account page and mails when disabled
* Option to limit products which are downloadable and virtual to 1 per cart

View File

@ -3,7 +3,9 @@
* Edit Address Form
*/
global $woocommerce;
global $woocommerce, $current_user;
get_currentuserinfo();
?>
<?php $woocommerce->show_messages(); ?>
@ -20,7 +22,9 @@ global $woocommerce;
<?php
foreach ($address as $key => $field) :
woocommerce_form_field( $key, $field, get_user_meta( get_current_user_id(), $key, true ) );
$value = (isset($_POST[$key])) ? $_POST[$key] : get_user_meta( get_current_user_id(), $key, true );
if (!$value && $key=='billing_email') $value = $current_user->user_email;
woocommerce_form_field( $key, $field, $value );
endforeach;
?>