Zen Cart Logo
Forums / General Questions / Two Contact Pages with different info

Two Contact Pages with different info

Locked

Views: 1,376

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
22 Jul 2009, 6:35 PM
#1
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Two Contact Pages with different info

Okay, I have been looking and found some similar questions but my problem is not that complicated.

I have one default form on the "Contact Us" page and I am adding whatever describing it in my "Admin-> Define Pages Editor-> define_contact_us.php" , but then our client wants another similar form on amother page (here LOcal Orders), only he wants his visitors to leave an order (locally) just using this form because he has only 3 choices for local and no credit card processing.

Basically I need excactly same form as Contact only it will have 3 pictures and different description. Thats it. What happens when I set in "define pages" is that it sets it up for the contact_us and i need to add another contact_us file i guess heh?

Somehow I thought if i set up the internal link and add html it will work but i guess i have to pick either one of those choices for my page.

anyways, i will appreciate your help

22 Jul 2009, 7:16 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Two Contact Pages with different info

You should be able to use one of the other define pages (page 2, page 3) and copy the code from the contact_us.php file into it, then add your images, and rename the page and link to Local Orders, or whatever.

22 Jul 2009, 7:21 PM
#3
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

Well, I would start by creating a new page. To do this have a look at a mod called About Us. Don't be put off by the name - it creates a page in the right place. And has great instructions about how to customise it, so that it doesn't have to be About Us, it could be called 'local orders'.

Once you have that page then you can work out which bits of the contact us page you want to copy into your new page and which parts you need to code yourself.

22 Jul 2009, 9:20 PM
#4
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Re: Two Contact Pages with different info

Alright, I will try both of these ways see what will work for him. Thanks! :hug:

22 Jul 2009, 11:02 PM
#5
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Re: Two Contact Pages with different info

I have been trying to customize page_2 file becasue it seemed a faster way of doin it. Basically it doesnt work yet.. I feel like it makes sense but somehow the contact form doesn show up.

I took this part of contact_us.php and pasted and customized it to the page_2.php file :

<?php
/**

  • @package languageDefines
  • @copyright Copyright 2003-2007 Zen Cart Development Team
  • @copyright Portions Copyright 2003 osCommerce
  • @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  • @version $Id: page_2.php 6202 2007-04-12 22:56:10Z drbyte $
    */

define('HEADING_TITLE', 'Local Orders');
define('NAVBAR_TITLE', 'Local Orders');
define('TEXT_SUCCESS', 'Your message has been successfully sent.');
define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME);

define('ENTRY_NAME', 'Full Name:');
define('ENTRY_EMAIL', 'Email Address:');
define('ENTRY_ENQUIRY', 'Message:');

define('SEND_TO_TEXT','Send Email To:');
define('ENTRY_EMAIL_NAME_CHECK_ERROR','Sorry, is your name correct? Our system requires a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters. Please try again.');
define('ENTRY_EMAIL_CONTENT_CHECK_ERROR','Did you forget your message? We would like to hear from you. You can type your comments in the text area below.');

define('NOT_LOGGED_IN_TEXT', 'Not logged in');
?>

anyways, the idea is right, right? it should take all those definitions and apply them to the page_2.php. But when I do it, the only thing I see is whatever I put in Define Pages for page_2 and NO form .. :no: i dunno, please help if you know.

here is the link to the page:
http://www.stephenmendenhall.com/delete_me/index.php?main_page=page_2

22 Jul 2009, 11:06 PM
#6
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

Well actually you want to be copying tpl_contact_us_default.php I think.

22 Jul 2009, 11:12 PM
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

Sorry, that was a bit brief.

tpl_contact_us_default.php contains the code that you require :smile:

You might want to remove lines 35-44 because this is putting in the text from the main contact us page as defined in admin. Or you could leave it in - depends what you like!

Let us know how you get on....

22 Jul 2009, 11:24 PM
#8
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

Looking at the site I think you have chosen the right one of the two options. That puts the link in a better place than my suggestion :D

23 Jul 2009, 1:02 AM
#9
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Re: Two Contact Pages with different info

Aright, i will keep playing around with it )) thnks for feedback :yes:

23 Jul 2009, 8:15 PM
#11
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Re: Two Contact Pages with different info

Well, I have downloaded the mod and I thought it will work because I have set up the fields I needed and got rid of the ones I didn't. But then when i fill up the form and click "send" it shows me an error for the required fields that are not even there. What am I doing wrong? :frusty: Bascially this is my tpl_band_signup_default.php I am talking about:

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: tpl_band_signup_default.php,v 1.3 2007/06/07 00:00:00 DrByteZen Exp $ // ?>

<div class="centerColumn" id="bandSignupDefault"> <h1 id="bandSignupDefaultHeading"><?php echo HEADING_TITLE; ?></h1> <?php if ($messageStack->size('band_signup') > 0) echo $messageStack->output('band_signup'); ?> <?php if (isset($_GET['action']) && ($_GET['action'] == 'success')) { ?> <div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div> <div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div> <?php } else { ?> <?php echo zen_draw_form('band_signup', zen_href_link(FILENAME_BAND_SIGNUP, 'action=send')); ?> <div id="bandSignupContent" class="content"> <fieldset id="bandSignup-Info"> <legend>Local Orders</legend> <div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div> <br class="clearBoth" />

<label class="inputLabel" for="band_name">Your Name:</label>

<?php echo zen_draw_input_field('band_name', zen_output_string_protected($band_name), ' size="30" id="band_name"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>

<br /><br />

<label class="inputLabel" for="contact1_email">Your Email:</label>

<?php echo zen_draw_input_field('contact1_email', zen_output_string_protected($contact1_email), ' size="30" id="contact1_email"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>

<br /><br />

<label class="inputLabel" for="mailing_address1">Mailing Address:</label>

<?php echo zen_draw_input_field('mailing_address1', zen_output_string_protected($mailing_address1), ' size="30" id="mailing_address1"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?> <br /> <br />

<label class="inputLabel" for="mailing_city">City:</label>

<?php echo zen_draw_input_field('mailing_city', zen_output_string_protected($mailing_city), ' size="30" id="mailing_city"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>

<br /><br />
<label class="inputLabel" for="mailing_zipcode">Postal/Zip code:</label>

<?php echo zen_draw_input_field('mailing_zipcode', zen_output_string_protected($mailing_zipcode), ' size="30" id="mailing_zipcode"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>

<br /><br />
<br class="clearBoth" />

<label for="comments">Your Order:</label>

<?php echo zen_draw_textarea_field('comments', 30, 4, zen_output_string_protected($comments), 'id="comments"'); ?> </fieldset> <br /> <!--<fieldset id="bandSignup-Conditions"> <legend>Terms and Conditions</legend> <?php echo zen_draw_checkbox_field('termsandconds', '1', false, 'id="termsandconds"');?> <label class="checkboxLabel" for="termsandconds">I have read and agree to the <a href="<?php echo zen_href_link(FILENAME_PAGE_4); ?>" target="_blank">user agreement</a>:</label> </fieldset>--> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div> <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div> <br class="clearBoth" /> </div> </form> <?php } ?> </div> </div>
23 Jul 2009, 8:45 PM
#12
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Two Contact Pages with different info

The following file deals with the validation:

includes/modules/pages/band_signup/header_php.php

23 Jul 2009, 9:42 PM
#13
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

Or the way of using page 2.

This is what I have put into the page from the admin panel:

<p><strong>Page 2 Sample Text ...</strong></p>
<p>This section of text is from the Define Pages Editor located under Tools in the Admin.</p>
<p>To remove this section of the text, delete it from the Define Pages Editor.</p>
<p>This file is located in<code> /languages/english/html_includes/classic/</code></p>
<p><strong>NOTE: Always backup the files in<code> /languages/english/html_includes/your_template</code></strong></p>

<div class="centerColumn" id="contactUsDefault">

<?php echo zen_draw_form('contact_us', zen_href_link(FILENAME_CONTACT_US, 'action=send')); ?>

<?php if (CONTACT_US_STORE_NAME_ADDRESS== '1') { ?>
<address><?php echo nl2br(STORE_NAME_ADDRESS); ?></address>
<?php } ?>

<?php
  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

<div class="buttonRow"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>

<?php
  } else {
?>


<?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?>

<fieldset id="contactUsForm">
<legend><?php echo HEADING_TITLE; ?></legend>
<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
<br class="clearBoth" />

<?php
// show dropdown if set
    if (CONTACT_US_LIST !=''){
?>
<label class="inputLabel" for="send-to"><?php echo SEND_TO_TEXT; ?></label>
<?php echo zen_draw_pull_down_menu('send_to',  $send_to_array, 0, 'id="send-to"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />
<?php
    }
?>

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME; ?></label>
<?php echo zen_draw_input_field('contactname', $name, ' size="40" id="contactname"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label class="inputLabel" for="email-address"><?php echo ENTRY_EMAIL; ?></label>
<?php echo zen_draw_input_field('email', ($error ? $_POST['email'] : $email), ' size="40" id="email-address"') . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?>
<br class="clearBoth" />

<label for="enquiry"><?php echo ENTRY_ENQUIRY . '<span class="alert">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_textarea_field('enquiry', '30', '7', '', 'id="enquiry"'); ?>

</fieldset>

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<?php
  }
?>
</form>
</div>

it need some tweaking ( the labels do not play the game) because it was simply cut and pasted from tpl_contact_us_default.

If you want to look at it it is on a test server at:

http://www.nick collie.co.uk/catalog/index.php?main_page=page_2&zenid=dm6cpk22pcf7vn1ci7os3fuv45

with the spaces taken out of the domain name. As i say it isn't pretty but it wouldn't take much to make it lovely.

27 Jul 2009, 7:11 PM
#14
orange_wacko avatar

orange_wacko

New Zenner

Join Date:
Jul 2009
Posts:
21
Plugin Contributions:
0

Re: Two Contact Pages with different info

Okay :shocking: I am on red DEADline .. ehh Please help me with the last part, prolly (I hope the easiest)-customization..

I got the form working! The link below. All I need now is to be able to add additional content to the form page. I want to know what I have to do to use the Define Pages feature. I just want to put a short guides on how to fill my form and put 3 screenshots of the Local Orders deals. :wacko:

I thought my admin would recognize this additional mode and see it in the Define Pages Aditor, i guess not?

Appreciate any help

http://www.stephenmendenhall.com/delete_me/index.php?main_page=band_signup

:blink:

27 Jul 2009, 7:46 PM
#15
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Two Contact Pages with different info

I don't know the mod but it looks like you can just edit tpl_band_signup_default.

Put what you want just after the last</form>

27 Jul 2009, 8:02 PM
#16
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Two Contact Pages with different info

  1. Create a blank php file named define_local_orders.php and upload it to includes/languages/english/html_includes and includes/languages/english/html_includes/your_template.

  2. In includes/templates/your_template/templates/tpl_band_signup_default.php

Just after this line:

<h1 id="bandSignupDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

Add this:

<?php
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', define_local_orders, 'false');
require_once($define_page);
?>