Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contact Us page contents


SalsaTim

Recommended Posts

I want to add my store contact information to the "Contact Us" page from the information panel on the bottom of my pages in my store.

I am trying to configure my store with osCommerce 2.34.BS Gold.

I have tried to add it to includes/languages/english/contact_us.php without any luck.  

 

Currently it looks like the picture Contact.png.

post-339320-0-46799900-1477425971_thumb.png

 

I want to have it look similar to NewContact.png.

post-339320-0-69691600-1477425994_thumb.png

 

Suggestions and recommendation are appreciated.

 

 

Thanks,

 

tim

Link to comment
Share on other sites

Modular Contact Us Page

 

**BACKUP FIRST**

 

Replace contents of catalog/contact_us.php with the following

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
    $error = false;

    $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']);

    if (!tep_validate_email($email_address)) {
      $error = true;

      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }

    $actionRecorder = new actionRecorder('ar_contact_us', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);
    if (!$actionRecorder->canPerform()) {
      $error = true;

      $actionRecorder->record(false);

      $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES : 15)));
    }

    if ($error == false) {
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

      $actionRecorder->record();

      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
    }
  }

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

<div class="page-header">
  <h1><?php echo HEADING_TITLE; ?></h1>
</div>

<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }
?>

<div class="contentContainer">
  <div class="row">
    <?php echo $oscTemplate->getContent('contact_us'); ?>
  </div>
</div>

</form>

<?php

  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Then upload contents of below zip file to your site (will not overwrite any files)

 

Go to Modules -> Content -> + Install Module -> Store Name, Address and Phone Number -> + Install Module (then set sort order and content width)

 

and

 

Modules -> Content -> + Install Module -> Contact Us Form -> + Install Module (then set sort order and content width)

contact_us_modules.zip

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

I did something a while back on my contact us page, and was thinking about making the page modular. Currently everything is hard coded into the contact_us page and the language files. I added the store address, the open times of the store and also a text panel.

 

Heres what I did.

I replaced

<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send'), 'post', 'class="form-horizontal"', true); ?>

<div class="contentContainer">
  <div class="contentText">

With

<div class="contentContainer">
  <div class="contentText">
  
<div class="row">

<div class="col-sm-12">
<div class="panel panel-default">
   <div class="panel-heading">
      <div class="panel-title"><i class="fa fa-info"></i> <?php echo CONTACT_US_INFORMATION_HEADING; ?></div>
   </div>
   <div class="panel-body">
      <?php echo CONTACT_US_TEXT_INFO; ?>
   </div>
</div>
</div>

<div class="col-sm-6">
<div class="panel panel-default">
   <div class="panel-heading">
      <div class="panel-title"><i class="fa fa-envelope"></i> <?php echo CONTACT_US_ADDRESS; ?></div>
   </div>
   <div class="panel-body"><address>
      <?php echo STORE_NAME; ?><br>
      <?php echo nl2br(STORE_ADDRESS); ?><br><br>
      <abbr title="Phone">P:</abbr> <?php echo STORE_PHONE; ?><br>
      <abbr title="Email">E:</abbr> <?php echo STORE_OWNER_EMAIL_ADDRESS; ?>
   </address></div>
   </div> 
</div>

<div class="col-sm-6">
<div class="panel panel-default">
   <div class="panel-heading">
      <div class="panel-title"><i class="fa fa-clock-o"></i> <?php echo CONTACT_US_OPENING_HEADING; ?></div>
   </div>
   <div class="panel-body">
      <?php echo CONTACT_US_OPENING; ?>
   </div>
</div>
</div> 
</div>

and in the language files I added

define('CONTACT_US_INFORMATION_HEADING', 'Information');
define('CONTACT_US_TEXT_INFO', '
<p>Add what ever text you want in here using HTML.</p>');

define('CONTACT_US_ADDRESS', 'Postal Address');
define('CONTACT_US_OPENING_HEADING', 'Working Hours');
define('CONTACT_US_OPENING', '
		Holidays: CLOSED<br/><br/>
		Mondays: 9-00am-5-30pm<br/>
		Tuesdays: 9-00am-5-30pm<br/>
		Wednesdays: 10-00am-7-00pm<br/>
		Thursdays: 9-00am-5-30pm<br/>
		Fridays: 9-00am-7-00pm<br/>
		Saturdays: 9-00am-1-00pm<br/>
		Sundays: CLOSED<br/>');

The store address was pulled from the admin configuration used throughout the store.

 

That gave me three new areas on the contact us page. One filled the whole width of the page and the other two took up 50% each.

 

I ought to make them into modules really, but at the time this was an easy solution.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Making it into a module was something that I was thinking about when I did the original changes, but never seemed to find the time. Glad you found the code idea useful.

 

May be the community could work on the contact_us page for Gary to help make that page modular to. He keeps saying that he needs help and input. I also have maths security type questions on that page rather than captcha which works really well.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...