My account remembers post data upon error
This commit is contained in:
parent
a2714544a4
commit
59c7ca1189
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
?>
|
||||
|
||||
|
|
Loading…
Reference in New Issue