View Single Post
  #4  
Old 05-15-2012, 09:34 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Changing Email Greeting to show First Name Only

No problem. See this code from salutation.tpl:
PHP Code:
{if $salutation ne ""}
   {
$lng.eml_dear|substitute:"customer":$salutation}
{else}
   {if 
$firstname eq ""}
       {
$lng.eml_dear_customer}
   {else}
       {
$lng.eml_dear|substitute:"customer":"`$title` `$firstname` `$lastname`"}
   {/if}
{/if} 

In your example you are substituting "customer" with $customer.firstname.

When passed from /common_files/mail/html/order_customer.tpl the $customer array is not set. $order is what it is pulling from, as you can see from the scrap of code I posted above.

To accomplish your goal, I believe you only need to remove the reference to $title and $lastname in salutation.tpl. Like this:
PHP Code:
{strip}
{if 
$salutation ne ""}
   {
$lng.eml_dear|substitute:"customer":$salutation}
{else}
   {if 
$firstname eq "" and $lastname eq ""}
       {
$lng.eml_dear_customer}
   {else}
       {
$lng.eml_dear|substitute:"customer":"`$firstname`"}
   {/if}
{/if}
{/
strip}, 
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote