Zen Cart Logo
Forums / General Questions / Multiple Contact Us Forms

Multiple Contact Us Forms

Locked

Views: 1,256

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
30 Apr 2009, 2:57 PM
#1
nickelleon avatar

nickelleon

New Zenner

Join Date:
Feb 2009
Posts:
5
Plugin Contributions:
0

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
// 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!
:lamo:

1 May 2009, 4:09 AM
#2
pdxdoug avatar

pdxdoug

Zen Follower

Join Date:
Jan 2008
Location:
Portland, Oregon USA
Posts:
356
Plugin Contributions:
0

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.

1 May 2009, 7:59 PM
#3
nickelleon avatar

nickelleon

New Zenner

Join Date:
Feb 2009
Posts:
5
Plugin Contributions:
0

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.

:clap: