Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to edit CONTACT_US Form?


itwebsolution

Recommended Posts

In catalog/includes/languages/english/contact_us.php add the following:

define('THIS', 'Send me this:');
define('THAT', 'Send me that:');

In catalog/contact_us.php find the following (near the top):

<?php
$error = false;
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
   $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']);

and replace the last line in that with:

    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['this']) . "\n";
   $enquiry .= tep_db_prepare_input($HTTP_POST_VARS['that']) . "\n";
   $enquiry .= tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

Further down that page find the entry fields for the email address:

                 <tr>
                   <td class="main"><?php echo ENTRY_EMAIL; ?></td>
                 </tr>
                 <tr>
                   <td class="main"><?php echo tep_draw_input_field('email'); ?></td>
                 </tr>

and add in after that:

                  <tr>
                   <td class="main"><?php echo THIS; ?></td>
                 </tr>
                 <tr>
                   <td class="main"><?php echo tep_draw_input_field('this'); ?></td>
                 </tr>
                 <tr>
                   <td class="main"><?php echo THAT; ?></td>
                 </tr>
                 <tr>
                   <td class="main"><?php echo tep_draw_input_field('that'); ?></td>
                 </tr>

Feel free to change the silly field names or the text in the defines. :rolleyes:

I just did a quick test and this seems to work. It puts the text entered in the two new fields at the top of the body of the message.

 

I'm off to finish adding new fields to mine. Please post here if you have any problems with this.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...