• Resolved creaselambert

    (@creaselambert)


    I have woocommerce set up and working correctly, I am just in need of a little tweak.

    On the my-account page the default is recent orders, which shows the recent orders a customer has made. But if there are no orders the page is blank.
    I would like to add a line of text to show that the page is loaded and maybe encourage the user to create an order.

    Where would I add this in to the my-orders or my-accounts pages to show only when there are no others orders present? Any help appreciated. Thanks.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I can’t find a suitable hook for this, so it means editing my-orders.php directly. This is not recommended since it will be overwritten at next update. But to answer the question, you would put something like this at the end of my-orders.php:

    <?php
      if ( !$customer_orders ) { // do this if no recent orders
        print '<p>No recent orders, why not create one?</p>';
      }
    ?>

    Not tested.

    Thread Starter creaselambert

    (@creaselambert)

    Thanks.

    I found this to work.

    if ( $customer_orders ) :
    // prints the orders table
    else :
      echo 'please buy some stuff';
    endif;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘"no recent orders"’ is closed to new replies.