Using Customer's Name Throughout the Site Like the Login Page Zencart

Please LogIn to Reply!

Post By: guest | 01-20-2013 07:57 Reply

Question




When customers log in they see a message like:

Hello [customer's name]! Would you like to see our newest additions?



How can I use the customer's name throughout the site on different pages?



What are the PHP variables and where do I put them? I would love to do this. I think it would really customize the user's experience. I hope someone has the answer.






Answers




I found the solution to my problem. I asked a friend of mine and he showed me this PHP code:




Code:

<?php  echo $_SESSION['customer_first_name']?>

Which is in the languages/english/index.php file. Now, I can use the customer's name throughout the site. I can say:



Thank you <?php echo $_SESSION['customer_first_name']?>. But this only works if the person has logged in.






Reply Or Comment!
Please LogIn to Reply!