Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Last active June 20, 2018 07:57
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameskoster/6776621 to your computer and use it in GitHub Desktop.
Save jameskoster/6776621 to your computer and use it in GitHub Desktop.
WooCommerce - Add a message above the login / register form on the my account page
add_action( 'woocommerce_before_customer_login_form', 'jk_login_message' );
function jk_login_message() {
if ( get_option( 'woocommerce_enable_myaccount_registration' ) == 'yes' ) {
?>
<div class="woocommerce-info">
<p><?php _e( 'Returning customers login. New users register for next time so you can:' ); ?></p>
<ul>
<li><?php _e( 'View your order history' ); ?></li>
<li><?php _e( 'Check on your orders' ); ?></li>
<li><?php _e( 'Edit your addresses' ); ?></li>
<li><?php _e( 'Change your password' ); ?></li>
</ul>
</div>
<?php
}
}
@gangesh
Copy link

gangesh commented Dec 16, 2015

Not working.

@nocean
Copy link

nocean commented Dec 24, 2015

I didn't utilize the get_option( 'woocommerce_enable_myaccount_registration' ) conditional, but otherwise this worked perfectly. Gangesh, if you are using that conditional, it feels like 'yes' should maybe be TRUE, but I'm not sure.

@atorresbr
Copy link

atorresbr commented Jun 20, 2018

Rocks perfect !. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment