Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatic address telephone & email in contact us


tayl1684

Recommended Posts

Hi.

 

Dont know if anyones interested in this, but I've just fiddled with the code in contactus.php to automatically add your store address and telephone number etc to contact us. If you change your details in the admin then this will change also.

 

The code is like so

 

<tr>

<td class="main">Our Address and Telephone Number:</td>

</tr>

<tr>

<td class="contactus"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">Our Email Address:

</tr>

<tr>

<td class="contactus"><a href="mailto:<?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?>"><?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?></a></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">Or contact us using the form provided below:</td>

</tr>

 

to be added just above

 

<tr>

<td class="main"><?php echo ENTRY_NAME; ?></td>

</tr>

 

I also made a new class in the stylesheet called contactus like so:

 

TD.contactus {

  font-family: Verdana, Arial, sans-serif;

  font-size: 14px;

  background: #ffffff;

  color: #000000;

  font-weight: bold;

}

 

Hope it proves usefull to someone.

 

Cheers

 

Ian

Link to comment
Share on other sites

  • 2 weeks later...

I've modified it so its a bit neater with borders around the address and email (so it looks more consistent with the stuff below.

 

Here is the new code.

 

<tr>

<td class="main">Our Address and Telephone Number:</td>

</tr>

<tr>

        <td><table border="1" width="100%" cellspacing="1" cellpadding="2">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="contactus"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>

</tr>

</table></td>

          </tr>

        </table></td>

      </tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">Our Email Address:

</tr>

<tr>

        <td><table border="1" width="100%" cellspacing="1" cellpadding="2">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="contactus"><a href="mailto:<?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?>"><?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?></a></td>

</tr>

</table></td>

          </tr>

        </table></td>

      </tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">Or contact us using the form provided below:</td>

</tr>

Cheers

 

Ian

Link to comment
Share on other sites

  • 2 months later...
I've modified it so its a bit neater with borders around the address and email (so it looks more consistent with the stuff below.

 

Here is the new code.

Cheers

 

Ian

 

 

thanks i tried it and it worked

 

rottimmy

Link to comment
Share on other sites

  • 3 weeks later...
Hi.

 

Dont know if anyones interested in this, but I've just fiddled with the code in contactus.php to automatically add your store address and telephone number etc to contact us. If you change your details in the admin then this will change also.

 

The code is like so

to be added just above

I also made a new class in the stylesheet called contactus like so:

Hope it proves usefull to someone.

 

Cheers

 

Ian

 

BRILLIANT - LOVED THIS FEATURE! (We're about to roll out our oscart version of the site and finding new features all the time!

[email protected]

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
Hi.

 

Dont know if anyones interested in this, but I've just fiddled with the code in contactus.php to automatically add your store address and telephone number etc to contact us. If you change your details in the admin then this will change also.

 

The code is like so

to be added just above

I also made a new class in the stylesheet called contactus like so:

Hope it proves usefull to someone.

 

Cheers

 

Ian

hello mate just what i am looking for but sadly i now get this error.

 

Warning: Cannot modify header information - headers already sent by (output started at /home/larkspur/public_html/includes/languages/english/contact_us.php:23) in /home/larkspur/public_html/includes/functions/general.php on line 29

 

Also i dont think this should matter but i have NOT modified my stylesheet yet,, or could this be my problem . by the way did i mention i think this is really cool.

many thanks

martin.

p.s if you want to test it yourslef please goto

www.

kinkylingerieworld.co.uk/contact_us.php

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 2 years later...
Can someone post this code explaining exactly what needs to be replaced or added where?

 

thanks

 

 

Great question! I put that excellent code into catalog/contact_us.php starting at about line 106 just in front of:

 

 

 <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><?php echo ENTRY_NAME; ?></td>

Link to comment
Share on other sites

to hide your email address from bots (less spam):

(you can edit the subject text)

 

 

Change:

<td class="contactus"><a href="mailto:<?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?>"><?php echo nl2br(STORE_OWNER_EMAIL_ADDRESS); ?></a></td>

 

 

To:

<td class="contactus">
<?php
$email = explode("@", STORE_OWNER_EMAIL_ADDRESS);
$user1 = $email[0];
$domain1 = $email[1];
$subject = 'Question for';
echo '
<script language="JavaScript">
<!--
var sign = "@";
var user = "'.$user1.'";
var domain = "'.$domain1.'";
var subject = "'.$subject.' '.$domain1 .'";';
echo"
document.write('<a href=\"mailto:' + user + sign + domain + '?subject=' + subject + '\">' + user + sign + domain + '</a>');";
echo '
// -->
</script>';
?>
</td>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...