Zen Cart Logo
Forums / General Questions / collect additional info..

collect additional info..

Locked

Views: 1,919

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
3 Feb 2007, 11:14 PM
#1
vik007 avatar

vik007

Zen Follower

Join Date:
Feb 2007
Posts:
201
Plugin Contributions:
0

collect additional info..

Hi guys,

iv created my own template and trying to gather more info from the contact page.

at the moment it is showing

name
email
message.

how do i make more options so that they can enter in there address, age etc...

thanxs in advance

4 Feb 2007, 4:43 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: collect additional info..

You can add the new inputs similar to the name ... but then you need to customize the file:
/includes/pages/contact_us/header_php.php

To include the information when the email is sent ...

6 Feb 2007, 11:19 PM
#3
vik007 avatar

vik007

Zen Follower

Join Date:
Feb 2007
Posts:
201
Plugin Contributions:
0

Re: collect additional info..

Ajeh:

You can add the new inputs similar to the name ... but then you need to customize the file:
/includes/pages/contact_us/header_php.php

To include the information when the email is sent ...

Thanks for the quick reply...

I would like customers to sign up before they are able to contact me.

is that possible?

thanxs

6 Feb 2007, 11:30 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: collect additional info..

You could test if the customer is logged in and if not send them to the login page first ...

This way, they would have to have an account or not be able to complete the form ...

Note: many will not be thrilled that they have to login to contact the site ...

18 Feb 2007, 6:53 PM
#5
vik007 avatar

vik007

Zen Follower

Join Date:
Feb 2007
Posts:
201
Plugin Contributions:
0

Re: collect additional info..

Ajeh:

You can add the new inputs similar to the name ... but then you need to customize the file:
/includes/pages/contact_us/header_php.php

To include the information when the email is sent ...

ok iv edited this file and the contact us page (http://unikids.splay.co.uk/zencart/index.php?main_page=contact_us)

and i can see the new title (book title) but when filled in the email only delivers the name, email and message? :cry:

HERE ARE PARTS OF THE FILES I AM EDITING:

this is part of my header file:

$error = false;
if (isset($_GET['action']) && ($_GET['action'] == 'send')) {
$name = zen_db_prepare_input($_POST['contactname']);
$booktitle = zen_db_prepare_input($_POST['booktitle']);
$email_address = zen_db_prepare_input($_POST['email']);
$enquiry = zen_db_prepare_input(strip_tags($_POST['enquiry']));

$zc_validate_email = zen_validate_email($email_address);

if ($zc_validate_email and !empty($enquiry) and !empty($name)) {
// auto complete when logged in
if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = :customersID";

$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
$check_customer = $db->Execute($sql);
$customer_email= $check_customer->fields['customers_email_address'];
$customer_booktitle= $check_customer->fields['customers_booktitle'];
$customer_name= $check_customer->fields['customers_firstname'] . ' ' . $check_customer->fields['customers_lastname'];
} else {
$customer_email='Not logged in';
$customer_name='Not logged in';

Do i need to add anything here???


part of my contact us page:

define('ENTRY_NAME', 'Full Name:');
define('ENTRY_BOOKTITLE', 'Book Title:');
define('ENTRY_EMAIL', 'Email Address:');

define('ENTRY_ENQUIRY', 'Message:');


part of my tpl_contact_us_default

<?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 class="inputLabel" for="booktitle"><?php echo ENTRY_BOOKTITLE; ?></label>

<?php echo zen_draw_input_field('booktitle', $name, ' size="40" id="booktitle"') . '<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>

REGARDS

VIK