Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Custom Email Form in Product Description

    I am trying to create a customer-selectable package deal. Basically the customer can configure their own package deal and send it as an email. So basically, I need to have a radio button and text box form within the product description:

    Code:
    <div itemprop="description" id="productDescription" class="productGeneral biggerText"> 
    </div>
    I have tried few custom email forms; however, since they contain php code above the HTML, when I save all of it in the product description, it shows all the PHP code as well as html, rendering it unusable.

    Sample HTML Form that I have tried:
    Code:
    <?php
    
    if($_POST["submit"]) {
        $recipient="[email protected]";
        $subject="Form to email message";
        $sender=$_POST["sender"];
        $senderEmail=$_POST["senderEmail"];
        $message=$_POST["message"];
    
        $mailBody="Name: $sender\nEmail: $senderEmail\n\n$message";
    
        mail($recipient, $subject, $mailBody, "From: $sender <$senderEmail>");
    
        $thankYou="<p>Thank you! Your message has been sent.</p>";
    }
    
    ?><!DOCTYPE html>
    
    
    
    
        <?=$thankYou ?>
    
        <form method="post" action="contact.php">
            <label>Name:</label>
            <input name="sender">
    
            <label>Email address:</label>
            <input name="senderEmail">
    
            <label>Message:</label>
            <textarea rows="5" cols="20" name="message"></textarea>
    
            <input type="submit" name="submit">
        </form>

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,684
    Plugin Contributions
    11

    Default Re: Custom Email Form in Product Description

    I'm curious as to why you would need to go outside the available processes of ZC to perform this. Even if all the options were up to the customer, couldn't you still use attributes to have them make/select a product?
    One of the most hacked items on sites today is the e-mail form.
    Perhaps, with a little more information about what you're wanting to do, we can come up with a more secure solution.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Re: Custom Email Form in Product Description

    Well...

    On my Zencart, I sell some items that cannot be purchased directly through the shopping cart. They basically have to email with the product with their individual needs with that item. Then I talk to them via email or phone afterwards with the specifics and the exact price. This is only for about 5% of the 2000 items I sell. For those items, I have been dealing with a customized 'Ask a Product Question' add-on and it has been working well for individual products.

    Now, I have present a package of above products to the customer. To get the idea access, lets just say we are talking about clothing. I sell hats, shirts, pants, and shoes that needs custom specifications. When those are individually sold, I have the add-on customized that they can send me their measurements and then I get back to them with a quote. But for the package deal, I have to present the hats, shirts, pants, and shoes together.

    So I need to come up with a product selector. Something similar to this:



    So I decided to attack this in 3 steps:

    1. Work on a basic HTML/PHP email form from product info page - (Zencart related, so that's why my op is about this)
    2. Work on a product sector with a custom radio button (broadly HTML/CSS/JQuery related, non Zencart related)
    3. Work on each selection section. (HTML, non Zencart related)
    Last edited by sle39lvr; 12 Apr 2015 at 08:48 PM.

  4. #4
    Join Date
    Jan 2011
    Posts
    196
    Plugin Contributions
    0

    Default Re: Custom Email Form in Product Description

    So far from reading on there, I found out that I can't really have PHP inside category description. So the next choice is add it as a product with attributes? Would I be able to hack the existing attribute div in to something that looks like above?

 

 

Similar Threads

  1. v150 Adding Multiple Images to Custom form To be sent to Admin Email
    By GodfatherAntiques in forum General Questions
    Replies: 56
    Last Post: 27 Sep 2021, 09:59 PM
  2. Create Custom Page with Email Form
    By bparker in forum General Questions
    Replies: 2
    Last Post: 17 Jan 2014, 05:54 PM
  3. Custom Form Field and Email Validation
    By zepher in forum Managing Customers and Orders
    Replies: 4
    Last Post: 26 Jan 2010, 12:45 AM
  4. Custom Form - Product Description
    By maizah in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 9 Dec 2008, 04:27 AM

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