WooCommerce: Edit “Returning Customer?” Message @ Checkout

When it comes to “editing” stuff, chances are WooCommerce gives us a “filter” we can use without overriding core. The more filters, the more customization we can do. In this case, I wanted to change the “Returning Customer?” message on my own checkout.

Editing the “Returning Customer” message @ WooCommerce checkout

PHP Snippet: Rename “Returning Customer?” @ WooCommerce Checkout


/**
 * @snippet       Rename "Returning Customer?" @ Checkout Page - WooCommerce
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=21719
 * @author        Rodolfo Melogli
 * @compatible    WC 3.5.4
 * @community     https://businessbloomer.com/club/
 */

add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );

function bbloomer_return_customer_message() {
return 'Have you shopped with us before?';
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Cart and Checkout on the Same Page
    This is your ultimate guide – complete with shortcodes, snippets and workarounds – to completely skip the Cart page and have both cart table and checkout form on the same (Checkout) page. But first… why’d you want to do this? Well, if you sell high ticket products (i.e. on average, you sell no more than […]
  • WooCommerce: Disable Payment Method If Product Category @ Cart
    Today we take a look at the WooCommerce Checkout and specifically at how to disable a payment gateway (e.g. PayPal) if a specific product category is in the Cart. There are two tasks to code in this case: (1) based on all the products in the Cart, calculate the list of product categories in the […]
  • WooCommerce: Add Privacy Policy Checkbox @ Checkout
    Here’s a snippet regarding the checkout page. If you’ve been affected by GDPR, you will know you now need users to give you Privacy Policy consent. Or, you might need customer to acknowledge special shipping requirements for example. So, how do we display an additional tick box on the Checkout page (together with the existing […]
  • WooCommerce: Redirect to Custom Thank you Page
    How can you redirect customers to a beautifully looking, custom, thank you page? Thankfully you can add some PHP code to your functions.php or install a simple plugin and define a redirect to a custom WordPress page (as opposed to the default order-received endpoint). This is a great way for you to add specific up-sells, […]
  • WooCommerce: Disable Payment Gateway by Country
    You might want to disable PayPal for non-local customers or enable a specific gateway for only one country… Either way, this is a very common requirement for all of those who trade internationally. Here’s a simple snippet you can further customize to achieve your objective. Simply pick the payment gateway “slug” you want to disable/enable […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

28 thoughts on “WooCommerce: Edit “Returning Customer?” Message @ Checkout

  1. Thanks for this. Is there a way to change the second part of the message is well? “Click here to Login”

  2. Hi there.

    Thanks for the amazing clue. It has worked beautifully.

    Just wondering, will there be snippet to remove the icon before the “Returning Customer?” so there would be only text without icon?

    1. Great! For that you probably need a bit of custom CSS

  3. Hi there, thanks again for this code!
    I am trying to simply remove this message (return an empty field), but that seems to throw some error message.
    See my code below. Is there a better way to return an empty field?

    //cart remove question box
    add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );
    if( wp_is_mobile()){ 
    function bbloomer_return_customer_message() {
    return '';
    }}
    

    and the error is:
    [Fri Jan 08 00:50:17.343559 2021] [Backend log: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘bbloomer_return_customer_message’ not found or invalid function name in /home/website/domains/…

    1. Hi Sander, the conditional check goes inside the function, not outside. Try that and let me know

      1. Hi Rodolfo, so sorry for the delay! I never realized you replied here.
        Is the code below as you suggested?
        I figured the issue was related to the empty field being returned.

        add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );
        function bbloomer_return_customer_message() {
        	if( wp_is_mobile() && is_checkout()){ 
        return '';
        }}
        
        1. Almost. You also need to target the “else”, and return the original string (which you need to pass to the function):

          add_filter( 'woocommerce_checkout_login_message', 'bbloomer_return_customer_message' );
          
          function bbloomer_return_customer_message( $message ) {
             if ( wp_is_mobile() && is_checkout() ) { 
                return '';
             } else return $message;
          }
          
  4. Hello, when clicked on “returning customer” there is this message “If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing & Shipping section.” Is it possible to change this message?

      1. Your link method also not working for this….

        1. Share your code please

  5. Hello, what php code snippet can I use to remove the automatic “returning customer” notice on my checkout page? Thanks!

    1. Hi Annaliese, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  6. Is there any option to keep the “Returning Customer? Click Here to Login” form in expanded state, so that user can directly view the login id and password boxes without clicking on the link?

    1. Hey there, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!

  7. Useful info. Fortunate me I found yolur web site by chance, and I am stunned why this twist of fate did not came about in advance!

    I bookmarked it.

    1. Thank you!

  8. Stills work on 01/23/19. Thanks!

    1. Excellent!

  9. Hi,
    Thanks for your insights.
    Like Ankur clicking on the link “click here to login” doesn’t do anything than go to the top of the page (Same for the link for the coupon code).
    Have you ever encountered that?

    When I inspect the code the url is only “#”.

    <a href="#" rel="nofollow">Klik hier om in te loggen</a>
    <a href="#" rel="nofollow">Klik hier om je code in te vullen</a>

    Any idea on how to get the right link there?

    All the best,
    Luc

    1. Hello Luc, thanks so much for your comment! I just retested this on the latest version of WooCommerce and it still works. Unfortunately this looks like custom troubleshooting work and I cannot help here via the blog comments. Thanks a lot for your understanding! ~R

  10. Hello, I am using Woocommerce 3.4.2 on my website eddyteddy.in and tried using this on Chrome ver 67 (in standard mode and incognito mode) but the login snippet isn’t working. I tried using it on Firefox and it worked perfectly. By not working, I meant that nothing happens when I click on it (in Chrome). I am working with php 7.2. Did you encounter this at your end? Can you help?

    1. Hey Ankur, thanks for your comment! PHP is browser-independent so maybe try to clear your Chrome cookies/cache ๐Ÿ™‚ I retested this on Woo 3.4.3 and still works. Let me know!

  11. Is there a way to edit the “If you have shopped with us before, please enter your details in the boxes below. If you are a new customer, please proceed to the Billing & Shipping section.” message

    1. Hey Dheeraj, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  12. Thank you!

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *