Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2010
    Posts
    11
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default 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
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Apr 2010
    Posts
    11
    Plugin Contributions
    0

    Default 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 :


  4. #4
    Join Date
    Jun 2010
    Location
    Virginia
    Posts
    20
    Plugin Contributions
    0

    Default 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]

  5. #5
    Join Date
    Jul 2004
    Posts
    246
    Plugin Contributions
    0

    Default 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.
    UK based Zen Cart Web Designer here www.handcoded.co.uk

  6. #6
    Join Date
    Sep 2010
    Posts
    19
    Plugin Contributions
    0

    Default 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.
    Victor
    Web Solutions
    Solving problems, as usual!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Contact Form in SideBox
    By makenoiz in forum General Questions
    Replies: 1
    Last Post: 18 Nov 2011, 07:55 PM
  2. Sidebox only in contact us page ...
    By monkeyjr47906 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 14 Dec 2007, 05:33 PM
  3. Contact us in Information sidebox
    By sharemind in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 Jul 2006, 05:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR