<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>multimixer &#187; email</title>
	<atom:link href="http://multimixer.gr/tag/oscommerce-email/feed/" rel="self" type="application/rss+xml" />
	<link>http://multimixer.gr</link>
	<description>lets talk about osCommerce</description>
	<lastBuildDate>Fri, 19 Nov 2021 08:23:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Add customers phone and email to the order confirmation email</title>
		<link>http://multimixer.gr/26/11/2010/add-customers-phone-and-email-to-the-order-confirmation-email/</link>
		<comments>http://multimixer.gr/26/11/2010/add-customers-phone-and-email-to-the-order-confirmation-email/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 15:32:54 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[osCommerce RC2a]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=425</guid>
		<description><![CDATA[The order confirmation email contains all kind of information except customers phone and email. Want to have customers phone and email in there too? It's really easy to do and won't cost you more than 2 minutes]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-437" title="order confirmation" src="http://multimixer.gr/wp-content/uploads/2010/11/handshake-525x350.jpg" alt="order confirmation" width="525" height="350" /></p>
<p>The order confirmation email contains all kind of information except customers phone and email. What if you need to contact your customer? The only way to do this in osCommerce is, to go to the administration panel, search for the customer and retrieve the information from there.</p>
<p>Why do have it that complicated? Why not to have the information right in the email? Let&#8217;s add phone and email into the order confirmation mail, it&#8217;s a simple 2 step and straightforward task.</p>
<p>We know that the mail is getting generated in file catalog/checkout_process.php. The lines we need to edit in this file are in the &#8220;// lets start with the email confirmation&#8221; section. It all depends where in the mail we want the information to appear, lets say we need it to be under the &#8220;billing address&#8221;.</p>
<p>In this case we go to the lines</p>
<pre class="brush:php; first-line:272">  $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
                  EMAIL_SEPARATOR . "\n" .
                  tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";</pre>
<p>Directly after hat we add</p>
<pre class="brush:php; first-line:275">// BOF Multimixer 26 11 10
  $email_order .= EMAIL_TEXT_CUSTOMER_TELEPHONE . ' ' . $order-&gt;customer['telephone'] . "\n";
  $email_order .= EMAIL_TEXT_CUSTOMER_MAIL . ' ' . $order-&gt;customer['email_address']. "\n\n";
// EOF Multimixer 26 11 10</pre>
<p>Basically we are done. Only thing we need to do now, is to add 2 more language definitions for the words &#8220;email&#8221; and &#8220;phone&#8221;. In file catalog/includes/languages/english/checkout_process.php add before the last ?&gt;</p>
<pre class="brush:php">// BOF Multimixer 26 11 10
define('EMAIL_TEXT_CUSTOMER_TELEPHONE', 'Telephone:');
define('EMAIL_TEXT_CUSTOMER_MAIL', 'email:');
// EOF Multimixer 26 11 10</pre>
<p>Thats it ! Enjoy :)</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/26/11/2010/add-customers-phone-and-email-to-the-order-confirmation-email/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Add customers phone to the contact us form in osCommerce</title>
		<link>http://multimixer.gr/26/11/2010/add-customers-phone-to-the-contact-us-form-in-oscommerce/</link>
		<comments>http://multimixer.gr/26/11/2010/add-customers-phone-to-the-contact-us-form-in-oscommerce/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 10:31:58 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=383</guid>
		<description><![CDATA[The "contact us" form consist in osCommerce of 3 fields: name, email and enquiry. How about adding customers phone number to the form? You can add any other input field you need, even drop down's radio buttons and checkboxes. ]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-389" title="Do you need your clients phone?" src="http://multimixer.gr/wp-content/uploads/2010/11/blackphone1-525x350.jpg" alt="Do you need your clients phone?" width="525" height="350" /></p>
<p>The &#8220;contact us&#8221; form consist in osCommerce of 3 fields: name, email and enquiry. What if you need for example your visitors phone number, so you can call them back?</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2010/11/contact1.jpg"><img class="aligncenter size-large wp-image-407" title="The default contact us form in osCommerce" src="http://multimixer.gr/wp-content/uploads/2010/11/contact1-525x252.jpg" alt="The default contact us form in osCommerce" width="525" height="252" /></a></p>
<p>Let&#8217;s add one more field to the contact us form. I&#8217;ll explain here how to do it for a phone number, you can do it for virtually any additional information you need.</p>
<p>Since we talk about the &#8220;contact us&#8221; form, the closest file to look at is of course the file catalog/contact_us.php. There is no real difference between RC2a and v2.3. LIne numbers in this post refer to v2.3</p>
<p>We&#8217;re going to add the input field for the phone number right under the email address field. The lines we need are</p>
<pre class="brush:php; first-line:86">      &lt;tr&gt;
        &lt;td class="fieldKey"&gt;&lt;?php echo ENTRY_EMAIL; ?&gt;&lt;/td&gt;
        &lt;td class="fieldValue"&gt;&lt;?php echo tep_draw_input_field('email'); ?&gt;&lt;/td&gt;
      &lt;/tr&gt;</pre>
<p>That&#8217;s the creation of the input field for the email. We just copy it, make it to be an input field for the phone number and add our new code just after</p>
<pre class="brush:php; first-line:90">      &lt;tr&gt;
        &lt;td class="fieldKey"&gt;&lt;?php echo ENTRY_PHONE; ?&gt;&lt;/td&gt;
        &lt;td class="fieldValue"&gt;&lt;?php echo tep_draw_input_field('phone'); ?&gt;&lt;/td&gt;
      &lt;/tr&gt;</pre>
<p>Next thing is to include the phone number into the email. The section of the file that do this is here</p>
<pre class="brush:php; first-line:20">    $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);</pre>
<p>Here we define 2 new variables $phone and $email_body by adding this just after</p>
<pre class="brush:php; first-line:23">	// add phone 26 11 10
	$phone = tep_db_prepare_input($HTTP_POST_VARS['phone']);
	// add email body 26 11 10
	$email_body = EMAIL_TEXT_CUSTOMER_NAME . ' ' . $name . "\r\n" . EMAIL_TEXT_CUSTOMER_EMAIL . ' ' .  $email_address . "\r\n" . EMAIL_TEXT_CUSTOMER_PHONE . ' ' . $phone . "\r\n" . EMAIL_TEXT_CUSTOMER_MESSAGE . ' ' . $enquiry;</pre>
<p>To $email_body we added the existing $name, $email_address and $enquiry. It&#8217;s much more handy that way, because we can add to it any new field we need anytime</p>
<p>Next thing is to include our new created $email_body into the mail function. So we replace in the existing function</p>
<pre class="brush:php; first-line:44">      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);</pre>
<p>the $enquiry with $email_body, so it looks like this</p>
<pre class="brush:php; first-line:44">      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $email_body, $name, $email_address);</pre>
<p>Last thing is to define what the text entries, like &#8220;ENTRY_PHONE&#8221; are.. If we don&#8217;t do it we will see the words &#8220;ENTRY_PHONE&#8221; printed on our screen. To do this, we need to go to file catalog/includes/languages/english/contact_us.php and add following definitions to the end of the file, before the last ?&gt;</p>
<pre class="brush:php">define('EMAIL_TEXT_CUSTOMER_NAME', 'Name:');
define('EMAIL_TEXT_CUSTOMER_EMAIL', 'email:');
define('EMAIL_TEXT_CUSTOMER_PHONE', 'Phone:');
define('EMAIL_TEXT_CUSTOMER_MESSAGE', 'Message:');
define('ENTRY_PHONE', 'Your phone number:');</pre>
<p>That&#8217;s it. Now we can take a look at our contact us page</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2010/11/contact2.jpg"><img class="aligncenter size-large wp-image-408" title="Phone number input field added" src="http://multimixer.gr/wp-content/uploads/2010/11/contact2-525x259.jpg" alt="Phone number input field added" width="525" height="259" /></a></p>
<p>In the same way you can create input field for any type of information, a new second text-area, a checkbox, a drop-down or radio buttons. There are pre-defined functions in osCommerce that make it easy</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/26/11/2010/add-customers-phone-to-the-contact-us-form-in-oscommerce/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
