title: Display a custom text when a registered customer has not yet purchased in WooCommerce
body: <p>In WooCommerce I have the following code that displays orders items names and order status from last customer order (registered customer):</p>
  <pre><code> &lt;?php
  
      // For logged in users only
      if ( is_user_logged_in() ) :
  
      $user_id = get_current_user_id(); // The current user ID
  
      // Get the WC_Customer instance Object for the current user
      $customer = new WC_Customer( $user_id );
  
      // Get the last WC_Order Object instance from current customer
      $last_order = $customer-&gt;get_last_order();
  
      $order_id     = $last_order-&gt;get_id(); // Get the order id
      $order_data   = $last_order-&gt;get_data(); // Get the order unprotected data in an array
      $order_status = $last_order-&gt;get_status(); // Get the order status
  
  
  &lt;div class=&quot;row last-order&quot;&gt;
      &lt;div class=&quot;col-md-7&quot;&gt;
          &lt;ul&gt;
          &lt;?php foreach ( $last_order-&gt;get_items() as $item ) : ?&gt;
              &lt;li&gt;&lt;?php echo $item-&gt;get_name(); ?&gt;&lt;/li&gt;
          &lt;?php endforeach; ?&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col-md-4 order-status-box&quot;&gt;
        &lt;h6 class=&quot;status&quot;&gt;&lt;?php echo esc_html( wc_get_order_status_name( $order_status ) ); ?&gt;&lt;/h6&gt;
        &lt;i class=&quot;fas fa-chevron-down icon&quot;&gt;&lt;/i&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;?php endif; ?&gt;
  </code></pre>
  <p>However, if the customer does not have any order, I would like it to display something like &quot;Have not purchased yet&quot;. I didn't find yet the way to do it.</p>
  <p>How and where to add a condition to display a custom text, when there is no last order for a registered customer?</p>