Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    5
    Plugin Contributions
    0

    Default Multiple Contact Us Forms

    Hello Zen Cart community!

    I am working with Zen Cart 1.38a on a project that requires 2 contact forms. The one that comes bundled with Zen Cart suffices for the basic contact form, but the other contact form needs to collect more information, specifically, the street address/city/state/zip.

    Currently I have it working like so
    1. I created an EZPage and changed the Internal Link URL to go to index.php?main_page=contact_us&request_catalog
    2. I modified /includes/templates/CUSTOM/templates/tpl_contact_us_default.php with this code:
      PHP Code:
      <?php
      // ask for address information if catalog is requested
          
      if (isset($_GET['request_catalog'])) {
      ?>
          <label class="inputLabel" for="streetaddress"><?php echo ENTRY_STREET_ADDRESS?></label>
          <?php echo zen_draw_input_field('streetaddress'$streetaddress' size="40" id="streetaddress"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
          <br class="clearBoth" />
          
          <label class="inputLabel" for="city"><?php echo ENTRY_CITY?></label>
          <?php echo zen_draw_input_field('city'$city' size="40" id="city"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
          <br class="clearBoth" />
          
          <label class="inputLabel" for="state"><?php echo ENTRY_STATE?></label>
          <?php echo zen_draw_input_field('state'$state' size="40" id="state"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
          <br class="clearBoth" />
          
          <label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE?></label>
          <?php echo zen_draw_input_field('postcode'$postcode' size="40" id="postcode"') . '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
          <br class="clearBoth" />

      <?php
          
      }
      ?>


    I know its a hack, but I couldnt figure out how to add an additional contact form. The 2 forms show up, great, but im still getting the contact_us email template which doesnt include the street address information. Simply modifying the contact us form to always ask for this information will not meet the requirements of this project. If the information doesnt need to be collected, it shouldnt be asked for, so 2 contact forms are needed.

    Im looking for any of the following:
    • The file that generates the body of the email template so I can add some more "isset, add" hacks
    • A way to create a new template for this 2nd contact form and have the system use this new template
    • The correct way to do this, because I feel like im hacking it too much


    I appreciate any and all assistance anyone can give me!

  2. #2
    Join Date
    Jan 2008
    Location
    Portland, Oregon USA
    Posts
    356
    Plugin Contributions
    0

    Default Re: Multiple Contact Us Forms

    In the submissions area there is one I found that is a "Band Sign-up". This might give you a little more insight to the form process.
    Attached Files Attached Files
    Doug

  3. #3
    Join Date
    Feb 2009
    Posts
    5
    Plugin Contributions
    0

    Default Re: Multiple Contact Us Forms

    PERFECT! Thank you so much, pdxdoug! I can reference the code / file structure to see how to properly do this now.


 

 

Similar Threads

  1. v151 Additional contact us forms reply-to field on e-mail.
    By charles.persinger in forum Managing Customers and Orders
    Replies: 0
    Last Post: 21 Dec 2013, 05:53 AM
  2. v139h Create account and contact forms not working
    By mcpisik in forum General Questions
    Replies: 12
    Last Post: 15 Feb 2012, 07:13 AM
  3. Creating contact forms?
    By sim8729 in forum General Questions
    Replies: 2
    Last Post: 7 Jul 2011, 11:25 PM
  4. Custom contact forms
    By raverX in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 18 Apr 2011, 04:45 PM
  5. forms validation recommendations for contact us??
    By tlyczko in forum General Questions
    Replies: 1
    Last Post: 28 Apr 2010, 06:12 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