Blog

5 Comments

  • […] has a tutorial on automatically linking past orders to WooCommerce customers when they register on your […]

  • Doug Smith 5 months ago Reply

    I had always wondered why this was not done automatically. It makes perfect sense now after reading your explanation of how it works.

    I did a little digging and found that the Customer List report actually does a similar search for previous orders just to decide if the button to link previous orders should be shown or not. It only returns the first order it can find with a matching e-mail address, but it’s still pretty intensive. The report won’t even finish loading the page on a site I have with a lot of orders—and now I understand why.

    • Beka Rice 5 months ago Reply

      Yep, that makes sense! As you can see this query is already being abstracted to use the new wc_get_orders() method, so hopefully when the underlying structure changes it can be much faster.

  • Gabrielle 3 months ago Reply

    Hi, what is, in your opinion, best setup for WC shop owners,
    when they just starting fresh on-line store?
    To force only registered users to register before buying product,
    and in long termprevent this time-consuming wc queries on register.
    Or allow unregistered users to buy, and when a blog/shop gets large
    in any post types number remove this snippet?
    Will WC authors consider to add this functions as default?
    Sorry for my poor English.

    • Beka Rice 3 months ago Reply

      Hey Gabrielle, we recommend allowing guest checkout, as there’s a fair bit of research that indicates allowing guest checkout improves conversions. I’d likely recommend this approach: “Or allow unregistered users to buy, and when a blog/shop gets large in any post types number remove this snippet?” Hopefully, for a new store, by the time your store gets large enough that this snippet would cause issues, WooCommerce will have already moved orders to a new data type (not posts), so one could avoid the issues I’ve outlined here 🙂

Submit a Comment