Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2011
    Posts
    11
    Plugin Contributions
    0

    Default Drop-down menu for email subject line in contact form

    Hello! First off, I'm completely new to PHP and especially Zen Cart. The client wanted me to help fix a badly customized site, and I'm stuck at this.

    I need to make a drop-down menu with subject selections (e.g., Orders Inquiry, Product Info Request, etc.), that will insert into into the subject line of the email.

    From digging through the forum, I found the solution separately only each of the tasks (1. how to set up a drop-down menu -- kinda; 2. how to insert subject line through a text input box). I don't know how to combine them together

    I added: ENTRY_DESCRIPTION and changed EMAIL_SUBJECT in contact_us.php:

    PHP Code:
    define('EMAIL_SUBJECT''JHL Style:' .$description);
    define('ENTRY_DESCRIPTION''Subject:'); 
    I found out about zen_draw_pull_down_menu and I tried to use it but I have no clue how to...

    PHP Code:
    <label class="inputLabel" for="subject"><?php echo ENTRY_DESCRIPTION?></label><br class="clearBoth" />
    <?php echo zen_draw_pull_down_menu('description', ($error $_POST['name'] : $description), ' size="50"'); ?>
    These are the options I want to add to the list:
    HTML Code:
    <select name="description">
    <option value="Order Inquiries">Order Inquiries</option>
    <option value="Returns & Exchanges">Returns & Exchanges</option>
    <option value="Product Questions">Product Questions</option>
    <option value="Find Your Essence">Find Your Essence</option>
    <option value="Other Inquiries">Other</option>
    </select>
    Thank you in advance for any insight!

    Here's the link to the form. It's so messy.
    Last edited by lastmiracle; 16 Jan 2012 at 10:16 AM. Reason: Added link to site

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Drop-down menu for email subject line in contact form

    There's a mod in the Free Sofware Add Ons that adds a Subject line to the Contact Us form. You might be able to add a dropdown to that.

    A little more information about the business issue you're trying to address would help, too. When I've wanted to have various Contact Us messages go to different places, I've just used a different email address for each, created them in Admin - Configuration - Email Options - Set "Contact Us" Email Dropdown List and done the sorting at the receiving end.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Drop-down menu for email subject line in contact form

    Instead if you simply add email addresses to the Contact Us Pulldown setting (Admin->Configuration->Email Options), you can direct those emails to different email addresses instead of fussing with any custom coding for subject lines. Assuming the code hasn't already been altered.
    .

    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.

  4. #4
    Join Date
    Nov 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: Drop-down menu for email subject line in contact form

    Thanks guys. I am aware of the email-to option, but the client wanted everything to be pointed to just one email address with different subject line..


  5. #5
    Join Date
    Nov 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: Drop-down menu for email subject line in contact form

    Here's an update, just for future references for other people who stumble on this:

    It's MUCH easier to set up multiple e-mail addresses per DrByte's suggestion. Here's how:

    Go to Admin->Configuration->Email Options, click Edit and type in:
    Subject1 <[email protected]>, Subject2 <[email protected]>, Subject3 <[email protected]>
    And it will show up automatically as a pull-down menu on your contact form, given that you didn't make any changes to /includes/templates/CUSTOM/templates/tpl_contact_us_default.php, where the default codes for the pull-down menu resides:

    PHP Code:
    <label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT?></label>
    <?php echo zen_draw_pull_down_menu('send_to',  $send_to_array0'id="send-to"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
    And you can change the default label for the list from "Send to Email" to anything, like "Subject", in /includes/languages/english/contact_us.php :

    PHP Code:
    define('SEND_TO_TEXT','Change your label here'); 
    Hope this helps!

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Drop-down menu for email subject line in contact form

    Make sure to put any language or template alterations into an appropriate override foldername, instead of editing the original files directly.
    .

    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. Replies: 4
    Last Post: 16 Aug 2012, 06:02 AM
  2. v139h Product Name to appear in Call for Price (contact us email subject line)
    By cmcneal in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Mar 2012, 11:25 AM
  3. Customer Specified Subject Line for Contact Form
    By jacdesigner in forum Basic Configuration
    Replies: 18
    Last Post: 31 Oct 2007, 11:01 AM
  4. Adding a subject line to the contact us form
    By bubblegumgoods in forum General Questions
    Replies: 2
    Last Post: 24 Jun 2007, 05:00 AM
  5. Contact us form drop down box for different departments?
    By immersive in forum General Questions
    Replies: 1
    Last Post: 29 Jan 2007, 09:44 PM

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