Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Super Contact us enhancement 1.0


John-Peter

Recommended Posts

I COULD NOT EDIT the top post,,

 

but i sorted it. I had

 

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

 

2 times on the contact us.php lol sorry

Glad you sorted it, and no need to be sorry.

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 339
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi there, I have just installed the Super Enhancement Contact Us enhancement. Nice Features. I am not receiving my email though. I am wondering if the template design I am using has anything to do with it.

When I click the continue button... the button doesn't seem to work. I have included my entire page code.

 

<?php
/*
 $Id: contact_us.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $

 E-Commerce Solutions

 Copyright (c) 2005 www.flash-template-design.com

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

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

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

if (tep_validate_email($email_address)) {
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));*/

  // BOF Super Contact us enhancement 1.41
$order_id = tep_db_prepare_input($HTTP_POST_VARS['order_id']);
if ($order_id <> NULL){
		$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}else{
	$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}

$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email_address)) {
	tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
if (CONTACT_US_LIST !=''){
	$send_to_array=explode("," ,CONTACT_US_LIST);
	preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
	$send_to_email= eregi_replace (">", "", $send_email_array[0]);
	$send_to_email= eregi_replace ("<", "", $send_to_email);

	tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
}else{
  //tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
  tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=send'));
}
// EOF Super Contact us enhancement 1.41

} else {
  $error = true;

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

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->

<tr>
<td width="182" align="left" valign="top">
<table width="182" cellpadding="0" cellspacing="0" border="0">
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
</table>
</td>
<td width="509" valign="top" style="padding-left:2px;">

	<table border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr>
						<td width="100%" height="100%" valign="top" bgcolor="#FFFFFF">

							<table border="0" width="100%" cellpadding="0" cellspacing="0" >
								<tr>
								<td width="100%" height="25" valign="top">
											<table width="100%" border="0" cellpadding="0" cellspacing="0" height="24">
	<tr>
		<td><img src="images/left_header.gif" width="4" height="24" alt="" /></td>
		<td width="100%" style="background-image:url(images/header_bg.gif); text-align:left; color:#FFF; padding-left:5px; font-size:110%; font-weight:bold "><?php
										echo HEADING_TITLE; ?>   
											</td>
		<td><img src="images/right_header.gif" width="4" height="24" alt="" /></td>			
	</tr>
</table>
	   											</td>
								</tr>

								<tr>
								<td valign="top" height="409" style="padding:0px 5px; " class="infoBox">

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





	 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
  </tr>
<?php
 if ($messageStack->size('contact') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('contact'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
?>

  <tr>
	  <td>
	<table border="0" width="100%" cellspacing="0" cellpadding="0" >
  <tr>
	<td class="main" align="center"><?php echo TEXT_SUCCESS; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td align="left"><table border="0" width="100%" cellspacing="1" cellpadding="2" >
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  </table></td></tr>
<!-- BOF Super Contact us enhancement 1.41 //-->
<?php
 } else {
 if (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$account = tep_db_fetch_array($account_query);

$name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
$email = $account['customers_email_address'];
 }
?>
<tr><td>

<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents"><td><table><tr>
	 <td class="main" valign="top" width=40%><b><?php echo nl2br(STORE_NAME_ADDRESS); ?></b><br><br>
			<?php echo (OPENING_HOURS); ?><br><br></td>
			<td class="main" valign="top" width="60%"><?php echo ENTRY_NAME; ?><br>
				<?php echo tep_draw_input_field('name'); ?><br />
				<?php echo ENTRY_EMAIL; ?><br>
				<?php echo tep_draw_input_field('email'); ?><br />
				<?php echo ENTRY_ORDER_ID; ?><br>
				<?php echo tep_draw_input_field('order_id'); ?><br />
				<?php
												   if (CONTACT_US_LIST !=''){
				  echo SEND_TO_TEXT . '<br>';
							  if(SEND_TO_TYPE=='radio'){
							  foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
						   if($k==0){
				$checked=true;
				}else{
				$checked=false;
				}
				echo tep_draw_radio_field('send_to', "$k", $checked). " " .preg_replace('/\<[^*]*/', '', $v);
						  }

									}else{
						  foreach(explode("," ,CONTACT_US_LIST) as $k => $v) {
					$send_to_array[] = array('id' => $k, 'text' => preg_replace('/\<[^*]*/', '', $v));
				 }
													   echo tep_draw_pull_down_menu('send_to',  $send_to_array);
									 }

									echo('<br>');
									}
																  ?>
																<?php echo ENTRY_REASON; ?><br>
				<select name="reason">
					<?php echo '<option value="' . REASONS1 . '">' . REASONS1 . '</option>'; ?>
					<?php echo '<option value="' . REASONS2 . '">' . REASONS2 . '</option>'; ?>
					<?php echo '<option value="' . REASONS3 . '">' . REASONS3 . '</option>'; ?>
					<?php echo '<option value="' . REASONS4 . '">' . REASONS4 . '</option>'; ?>
					<?php echo '<option value="' . REASONS5 . '">' . REASONS5 . '</option>'; ?>
					<?php echo '<option value="' . REASONS6 . '">' . REASONS6 . '</option>'; ?>

				</select><br />
				<?php echo ENTRY_ENQUIRY; ?><BR>
				<?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15, tep_sanitize_string($_POST['enquiry']), '', false); ?>
				<br />
				</td></tr></table></td>
</tr>
</table>
<br />
<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 width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo tep_image_submit('button_send.gif', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td></tr>   
<?php
 }
?>
<!-- EOF Super Contact us enhancement 1.41 //-->
</table></td></tr>  </table></td>
								</form>


					</tr>


				</table>
			</td>
		</tr>




<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->


</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Hi there, I have just installed the Super Enhancement Contact Us enhancement. Nice Features. I am not receiving my email though. I am wondering if the template design I am using has anything to do with it.

When I click the continue button... the button doesn't seem to work. I have included my entire page code.

I installed Start Super Contact us enhancement 1.4 and added the vvc code later, so I don't know about the later versions.

 

One question is are you receiving any emails from your shop? If not, that may be template issue or not.

 

I assume that this version has an sql file and you ran it in phpmyadmin.

 

One more thought, if all else fails, download osc from the blue solutions tab at the top of the page. Compare your cont_us file to the unmodified one there. It may help with the edits.

Edited by Coopco
Link to comment
Share on other sites

I will try that. I don't have other forms on my shop but I did a standard php contact form and received that form without problems. I really think its a template issue.

Link to comment
Share on other sites

I will try that. I don't have other forms on my shop but I did a standard php contact form and received that form without problems. I really think its a template issue.

Yes, but was the form you sent part of osc? Do yo get order emails, both as a customer and the admin? Do you get order update emails when you change the order status in admin?

Link to comment
Share on other sites

I don't use the site as a shopping site... I deactivated all the buy now buttons. It purely displays products. I don't even have an option for customers to register. Client did not want that.

 

The contact form is the only form I have on my site.

Link to comment
Share on other sites

Ok... I decided to do things the backwards route.... I took an original contact_us.php from a new osc. and uploaded it and it worked so I am going to try styling that form to match my template and add the super contact enhancement module.

If I get stuck I will shout. Thanks for the nudge Coopco.

Link to comment
Share on other sites

I have cracked it!!!!! :D

 

I didn't need to restyle.... On my template my header was

<?php echo HEADING_TITLE; ?>

I changed that to

<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

 

Form works... just got to change my header and the success page.

 

Thanks again

Link to comment
Share on other sites

I have cracked it!!!!! :D

 

I didn't need to restyle.... On my template my header was

<?php echo HEADING_TITLE; ?>

I changed that to

<?php echo tep_draw_form('contact_us', tep_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

 

Form works... just got to change my header and the success page.

 

Thanks again

Well done, you solved it.

Link to comment
Share on other sites

I have installed this module - it was working ok for a while but suddenly it has stopped working. I am not too sure what has gone wrong as I don't remember changing anything, I have changed hosts but all my email addresses are the same as before.

What can I do to correct this?

Link to comment
Share on other sites

Hi, I am just setting up a store that will be using the 'call for price' contribution with a link on the product page to the contact us form, if I was to use this contribution would it be able to pass the product name to the form with out the need of typing it, also have the product title passed on to the email.

 

Thanks

 

Rachel

Link to comment
Share on other sites

The Super Contact Us enhancement is great!

 

One issue I am having though is I receive the following two SMTP errors upon submitting the form.

 

 

Warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in D:\Hosting\3645952\html\store\catalog\includes\classes\email.php on line 522

 

Warning: mail() [function.mail]: SMTP server response: 503 RCPT first (#5.5.1) in D:\Hosting\3645952\html\store\catalog\includes\classes\email.php on line 522

 

 

It is probably a simple fix...I am just new php.

 

Any help would be appreciated!

 

Thanks,

Joe

Link to comment
Share on other sites

Are there any removal instructions for this module?

 

Particularly how to remove:

 

INSERT INTO configuration SET configuration_title='Set "Contact Us" Email List', date_added=NOW(), sort_order='11', configuration_group_id='1', configuration_key='CONTACT_US_LIST', configuration_value= '', configuration_description='On the "Contact Us" Page, set the list of email addresses , in this format: Name 1 <email@address1>, Name 2 <email@address2>', use_function = NULL , set_function = NULL;
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

Does anybody have this working properly on php5. All emails are being sent to the store owner and store owner email addy. Can't seem to find the problem anywhere. Any ideas anyone??

 

Thanks

I only do what my Rice Krispies tell me to do!

Link to comment
Share on other sites

It works with php5. I use it.

 

Did you run the SQL?

did you set in admin where to send orders to?

Edited by newtest
Link to comment
Share on other sites

It works with php5. I use it.

 

Did you run the SQL?

did you set in admin where to send orders to?

 

Yes and Yes. It's pulling the names from the contact list for the radio buttons but it's not pulling anything for the actual email. I guess I'll keep poking around

I only do what my Rice Krispies tell me to do!

Link to comment
Share on other sites

  • 4 months later...

Oke, i have a proble with this contribution.

 

In fact i don't think the contribution is my problem but more the template that i bought and using

 

The problem that i have

 

Fatal error: Cannot redeclare tep_show_category() (previously declared in /usr/home/vdfso/public_html/****/includes/header.php:199) in /usr/home/vdfso/public_html/****/includes/boxes/categories.php on line 58

 

I did already followed following advices:

http://www.oscommerce.com/forums/index.php?sho...mp;#entry931596

 

and

 

http://www.oscommerce.com/forums/index.php?sho...t=#entry1124501

 

The problem is away but i'm getting then a second category tree in my body site where normally the products are.

 

Is there any one who can help me?

 

Thanks already

 

Regards

Pieter

Link to comment
Share on other sites

Hmm tobe honest it seems that the mail adress list is skiped totaly

 

This works since it reads the STORE_OWNER_EMAIL_ADDRESS and not from the email list...

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);

 

BUT

There is no Email Subject: (from the list) as subject it only says "Enquiry from THE COMPANY NAME"

Link to comment
Share on other sites

Hmm tobe honest it seems that the mail adress list is skiped totaly

 

This works since it reads the STORE_OWNER_EMAIL_ADDRESS and not from the email list...

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);

 

BUT

There is no Email Subject: (from the list) as subject it only says "Enquiry from THE COMPANY NAME"

includes\languages\english\contact_us.php

 

define('EMAIL_SUBJECT', 'Enquiry from ' . STORE_NAME);

Link to comment
Share on other sites

  • 3 months later...

This is a great contribution but I’m having a small issue when the customer leaves out required information. If the customer doesn't enter an email address and clicks continue the success page is loaded. See the link below:

 

my contact us page – if you leave all fields blank and click continue and you'll see what I mean.

 

entering all the required fields and it works perfectly. The problem seems to be linked to this part of the installation below as changing "send" back to "success" fixes the problem when required info is left blank but when all required information is present the customer doesn’t get onscreen notification (i.e. your email ahs been sent) but I do get the emails successfully.

 

Step 5
======

In this same file search for the word "success" and replace it with "send".
The line that you are looking for looks like this:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

and it should look like this:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

 

Hope this all makes sense. Any help appreciated.

Link to comment
Share on other sites

  • 4 weeks later...

This is a great contribution but I’m having a small issue when the customer leaves out required information. If the customer doesn't enter an email address and clicks continue the success page is loaded. See the link below:

 

my contact us page – if you leave all fields blank and click continue and you'll see what I mean.

 

entering all the required fields and it works perfectly. The problem seems to be linked to this part of the installation below as changing "send" back to "success" fixes the problem when required info is left blank but when all required information is present the customer doesn’t get onscreen notification (i.e. your email ahs been sent) but I do get the emails successfully.

 

Step 5
======

In this same file search for the word "success" and replace it with "send".
The line that you are looking for looks like this:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {

and it should look like this:
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

 

Hope this all makes sense. Any help appreciated.

I have (from an add on from memory)

 

// Contact_Us_Field_Validation - Simple Fix

// if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && $messageStack->size('contact') < 1) {

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...