Jump to content

How to put in a template "if a customer is new or not"?


markinhos3

Recommended Posts

Hi guys!!  :)  My prestashop version is 1.6.1.10

 

What I want is put in some place of invoice.tpl "if the customer is new or not in my shop".

 

I'm using this code at the end of invoice.tpl:

{if (Order::getCustomerOrders((int)$this->context->customer->id) > 1)}
    <span> Old Customer </span>
{else}
    <span> New Customer </span>
{/if}	

I know with this i get an array and I have to use the property count , but I don't know how to do it well, please someone could help me?

 

A lot of thanks in advance!!  :) 

Link to comment
Share on other sites

Hi ndiaga!!Thank you for your replay!

 

What i need is to show in the invoice.tpl a sentence saying: New/Old Customer

 

Then i need to get the number of orders by id_customer and make a condition with IF:

 

if number of orders > 1 , then print "Old Customer"

 

else, print "New Customer"

 

What i don't know is how to do the count of orders and put it in a correct sentence, and call the function getCustomerOrders correctly, plus make the conditions well.

 

Thank you again for your attention!

Link to comment
Share on other sites

  • 2 years later...

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...