Jump to content

[SOLVED] Is there a system variable to check if customer has already completed an order/payment?


Recommended Posts

Hi all

I want to show/hide a menu item in "My Account" depending if the customer has already completed an order/payment.

By using themes/classic/templates/customer/my-account.tpl, you can show/hide menu items in "My Account".

Those items are shown/hidden depending on the "if" statement, for example, the following (if $customer.addresses|count) statement checks that the customer has already entered an address:

{if $customer.addresses|count}
        <a class="col-lg-4 col-md-6 col-sm-6 col-xs-12" id="addresses-link" href="{$urls.pages.addresses}">
          <span class="link-item">
            <i class="material-icons">&#xE56A;</i>
            {l s='Addresses' d='Shop.Theme.Customeraccount'}
          </span>
        </a>
      {else}
        <a class="col-lg-4 col-md-6 col-sm-6 col-xs-12" id="address-link" href="{$urls.pages.address}">
          <span class="link-item">
            <i class="material-icons">&#xE567;</i>
            {l s='Add first address' d='Shop.Theme.Customeraccount'}
          </span>
        </a>
      {/if}

 

So how to check in the same way if the customer has already completed an order/payment? I guess it is something like:

if $customer.order|count 

but I am afraid customer.order doesn't work and I cannot figure out the solution.

 

Thanks in advance

 
  •  
Edited by bepot (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...