-
Contact Us Sidebox
My client has requested that a sidebox be added to their site which performs the function of the "Contact Us" page (ie - visitor fills out form and details are emailed to owner).
I have been searching the Add-ons and Forums but have been unable to identify an available Sidebox or instructions as to how this may be accomplished.
I have had a look at Blank Sidebox with the thought of manipulating the php code of the tpl_contact_us_default.php however I am not having any luck, and I believe that this thread explains where I am getting stuck, but I am positive that there is a way to achive the desired outcome.
Any help would be greatly appreciated.
Thank you
-
Re: Contact Us Sidebox
The contact us sidebox code already exists in the information sidebox
Grab it and insert into the blank sidebox file
After you have success - remove the code from the info sidebox file
Use overrides for both of these edited files
-
Re: Contact Us Sidebox
Thanks for the reply. I believe I may have not been clear enough. They have requested that the Contact Us form be in the Sidebox so that the visitor can complete the form at any time within the Sidebox (without having the need to navicate to the "Contact Us" page.)
Here is a graphical representation of what I am trying to achieve :
http://flowerswithstyle.com.au/images/Contact.JPG
-
Re: Contact Us Sidebox
[FONT="Comic Sans MS"]Has anyone figured out how to do this? I want a sidebox that will let my customers submit a comment.[/FONT]
-
Re: Contact Us Sidebox
How about this
Make a side banner box
Paste the html into the banner that builds the contact form i.e
<div id="form">
Please use the form below:
<form action="submitemail.php" id="submitform" method="post">
<p><input name="name" type="text" value="Name..."/></p>
<p><input name="email" type="text" value="Email..."/></p>
<p><textarea name="message" cols="" rows="6">Message...</textarea></p>
<input name="submit" type="image" src="images/submit.png" value="submit"/>
</form>
Make a file called submitemail.php and upload this to your catalog root folder
Here is the code
<?
/************************
* Variables you can change
*************************/
$mailto = "[email protected]";
$cc = "";
$bcc = "";
$subject = "Message from my shop";
$vname = "Message from my shop";
/************************
* do not modify anything below unless you know PHP/HTML/XHTML
*************************/
$email = $_POST['email'];
function validateEmail($email)
{
if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,3})?(\.[a-zA-Z]{2,3})?$', $email))
return true;
else
return false;
}
if((strlen($_POST['name']) < 1 ) || (strlen($email) < 1 ) || (strlen($_POST['message']) < 1 ) || validateEmail($email) == FALSE){
$emailerror .= '';
if(strlen($_POST['name']) < 1 ){
$emailerror .= '<li>Enter name</li>';
}
if(strlen($email) < 1 ){
$emailerror .= '<li>Enter email</li>';
}
if(validateEmail($email) == FALSE) {
$emailerror .= '<li>Enter valid email</li>';
}
if(strlen($_POST['message']) < 1 ){
$emailerror .= '<li>Enter message</li>';
}
} else {
$emailerror .= "Your email has been sent successfully";
// NOW SEND THE ENQUIRY
$timestamp = date("F j, Y, g:ia");
$messageproper ="\n\n" .
"Name: " .
ucwords($_POST['name']) .
"\n" .
"Email: " .
ucwords($email) .
"\n" .
"Message: " .
$_POST['message'] .
"\n" .
"\n\n" ;
$messageproper = trim(stripslashes($messageproper));
mail($mailto, $subject, $messageproper, "From: \"$vname\" <".$_POST['e_mail'].">\nReply-To: \"".ucwords($_POST['first_name'])."\" <".$_POST['e_mail'].">\nX-Mailer: PHP/" . phpversion() );
}
?>
<div id='emailerror'>
<ul>
<? echo $emailerror; ?>
</ul>
</div>
That should do it.
-
Re: Contact Us Sidebox
I have created a new sidebox with more flexibility, it should soon appear at the free addons section of Zen Cart site.
Enjoy.
-
Re: Contact Us Sidebox
Um ... the code posted by longstockings and repackaged by acedweb has security vulnerabilities and is NOT compatible with PHP 5.3 conventions.
The better solution would be to use the built-in contact-us capability already in Zen Cart.