Zen Cart Logo
Forums / Addon Sideboxes / Contact Us Sidebox

Contact Us Sidebox

Locked

Views: 2,685

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
11 May 2010, 10:17 PM
#1
dcitsolutions avatar

dcitsolutions

New Zenner

Join Date:
Apr 2010
Posts:
11
Plugin Contributions:
0

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

11 May 2010, 10:29 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

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

11 May 2010, 10:57 PM
#3
dcitsolutions avatar

dcitsolutions

New Zenner

Join Date:
Apr 2010
Posts:
11
Plugin Contributions:
0

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 :

19 Aug 2010, 6:39 PM
#4
the_enchanted avatar

the_enchanted

New Zenner

Join Date:
Jun 2010
Location:
Virginia
Posts:
20
Plugin Contributions:
0

Re: Contact Us Sidebox

Has anyone figured out how to do this? I want a sidebox that will let my customers submit a comment.

23 Sep 2010, 1:29 PM
#5
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

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.

30 Sep 2010, 2:05 PM
#6
acedweb avatar

acedweb

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

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.

30 Sep 2010, 8:24 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

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.