Jump to content



Photo
* * * - - 5 votes

Adding Custom Fields to Customer Details


This topic has been archived. This means that you cannot reply to this topic.
84 replies to this topic

#41   julia

julia
  • Members
  • 259 posts

Posted 13 September 2005 - 11:23

it works just fine! but i realized you have to be really careful with the input fields, no mistakes or nothing will work /wink.gif' class='bbc_emoticon' alt=';)' />
yours, Mark

<{POST_SNAPBACK}>


That's exacty it Mark. There are so many places that you have to list the variable, and if you cut and paste and forget to change one, it won't work. Plus you have to do it again on the edit account, and the admin..so there are alot of areas for an error.
Julie

#42   sarah1980

sarah1980
  • Members
  • 198 posts

Posted 15 September 2005 - 02:33

Can someone tell me if the extra fields that you ask the customer to fill in are viewable on their invoice or their order information or customer information?

#43   markschaef

markschaef
  • Members
  • 18 posts

Posted 15 September 2005 - 05:35

Can someone tell me if the extra fields that you ask the customer to fill in are viewable on their invoice or their order information or customer information?

<{POST_SNAPBACK}>


if these extra fields are edited in the invoice.php as well, yes!
but you have to insert the same tags there as well - like the tag to get them from the DB

yours, mark

#44   sarah1980

sarah1980
  • Members
  • 198 posts

Posted 16 September 2005 - 16:08

if these extra fields are edited in the invoice.php as well, yes!
but you have to insert the same tags there as well - like the tag to get them from the DB

yours, mark

<{POST_SNAPBACK}>

Sorry, which code do I need to add in the invoice.php?

#45   markschaef

markschaef
  • Members
  • 18 posts

Posted 16 September 2005 - 18:00

Sorry, which code do I need to add in the invoice.php?

<{POST_SNAPBACK}>

I dont know what your extra fields look like or where they are stored at in the DB
but you have to get them out of there (by QUERY)
inside the invoice.php
and then to display them like <?php echo query['field'];?>

#46   tec

tec
  • Members
  • 580 posts

Posted 17 September 2005 - 04:47

On my check out shipping page, i have the Gift wrap mod installed, if i wanted to add the fields
- Is this for a male or female?
- What is the occassion?
- WHat do you wish the gift card to say?

would i do it the same way but only to the checkout shipping page? and what table would i edit in the DB to add these new fields?

I also need to have it shown on the Admin Orders Status Page and shown within the order confirmation email sent to both customer and store owner.

#47   tec

tec
  • Members
  • 580 posts

Posted 17 September 2005 - 06:49

This is what I have on my checkout_shipping.php, i must be missing something on this file though, it was too simple to do /wink.gif' class='bbc_emoticon' alt=';)' />
Now god knows, this is the only page i have been able to try to figure out, though it is probably off by a mile, I started editing the admin/orders.php but thought i better come back first


[code=auto:0]
<?php

/*

$Id: checkout_shipping.php,v 1.16 2003/06/09 23:03:53 hpdl Exp $



osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com



Copyright © 2003 osCommerce



Released under the GNU General Public License

*/



require('includes/application_top.php');

require('includes/classes/http_client.php');



// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}



// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}



// if no shipping destination address was selected, use the customers own address as default

if (!tep_session_is_registered('sendto')) {

tep_session_register('sendto');

$sendto = $customer_default_address_id;

} else {

// verify the selected shipping address

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");

$check_address = tep_db_fetch_array($check_address_query);



if ($check_address['total'] != '1') {

$sendto = $customer_default_address_id;

if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');

}

}



require(DIR_WS_CLASSES . 'order.php');

$order = new order;



// register a random ID in the session to check throughout the checkout procedure

// against alterations in the shopping cart contents

if (!tep_session_is_registered('cartID')) tep_session_register('cartID');

$cartID = $cart->cartID;



// if the order contains only virtual products, forward the customer to the billing page as

// a shipping address is not needed

// ###### Added CCGV Contribution #########

// if ($order->content_type == 'virtual') {

if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {

// ###### End Added CCGV Contribution #########

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

$shipping = false;

$sendto = false;

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}



$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

// load giftwrap module
require(DIR_WS_CLASSES . 'gift.php');
$giftwrap_modules = new gift;

// process the selected giftwrap method
if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
if (!tep_session_is_registered('giftwrap_info')) tep_session_register('giftwrap_info');

if (tep_count_giftwrap_modules() > 0) {
if ( (isset($HTTP_POST_VARS['giftwrap'])) && (strpos($HTTP_POST_VARS['giftwrap'], '_')) ) {
$giftwrap_info = $HTTP_POST_VARS['giftwrap'];

list($module, $method) = explode('_', $giftwrap_info);
if (is_object($$module)) {
$quote1 = $giftwrap_modules->quote1($method, $module);
if (isset($quote1['error'])) {
tep_session_unregister('giftwrap');
} else {
if ( (isset($quote1[0]['methods'][0]['title'])) && (isset($quote1[0]['methods'][0]['cost'])) ) {
$giftwrap_info = array('id' => $giftwrap_info,
'title' => $quote1[0]['module'] . ' (' . $quote1[0]['methods'][0]['title'] . ')',
'cost' => $quote1[0]['methods'][0]['cost']);
}
}
} else {
tep_session_unregister('giftwrap_info');
}
}
} else {
$giftwrap_info = false;
}
}

// get all available giftwrap quotes
$quotes1 = $giftwrap_modules->quote1();

// add gift message
if ($HTTP_GET_VARS['action'] == 'update') {
if (tep_not_null($HTTP_POST_VARS['giftMessage']) && tep_session_is_registered('giftwrap_info')) {
$giftMessage = tep_db_prepare_input($HTTP_POST_VARS['giftMessage']);

if (tep_session_is_registered('customer_id')) {
tep_db_query("update " . TABLE_ORDERS . " set giftMessage = '" . tep_db_input($giftMessage) . "' where customers_id = '" . $customer_id . "' and orders_id = '" . $order_id . "'");
} else {
tep_db_query("update " . TABLE_ORDERS . " set giftMessage = '" . tep_db_input($giftMessage) . "' where customers_id = '0' and orders_id = '" . $order_id . "'");
}

tep_session_unregister('giftwrap_info');
}
}

// what is the recipients info?

$occasion = tep_db_prepare_input($HTTP_POST_VARS['occasion']);
$recipient sex = tep_db_prepare_input($HTTP_POST_VARS['recipient sex']);
if ($HTTP_GET_VARS['action'] == 'update') {
if (tep_not_null($HTTP_POST_VARS['occasion']) && tep_session_is_registered('occasion_info')) {
$occasion = tep_db_prepare_input($HTTP_POST_VARS['occasion']);

if (tep_session_is_registered('customer_id')) {
tep_db_query("update " . TABLE_ORDERS . " set occasion = '" . tep_db_input($occasion) . "' where customers_id = '" . $customer_id . "' and orders_id = '" . $order_id . "'");
} else {
tep_db_query("update " . TABLE_ORDERS . " set occasion = '" . tep_db_input($occasion) . "' where customers_id = '0' and orders_id = '" . $order_id . "'");
}

if ($HTTP_GET_VARS['action'] == 'update') {
if (tep_not_null($HTTP_POST_VARS['recipient sex']) && tep_session_is_registered('recipient sex_info')) {
$occasion = tep_db_prepare_input($HTTP_POST_VARS['recipient sex']);

if (tep_session_is_registered('customer_id')) {
tep_db_query("update " . TABLE_ORDERS . " set recipient sex = '" . tep_db_input($recipient sex) . "' where customers_id = '" . $customer_id . "' and orders_id = '" . $order_id . "'");
} else {
tep_db_query("update " . TABLE_ORDERS . " set recipient sex = '" . tep_db_input($recipient sex) . "' where customers_id = '0' and orders_id = '" . $order_id . "'");
}
// load all enabled shipping modules

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping;



if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {

$pass = false;



switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

case 'national':

if ($order->delivery['country_id'] == STORE_COUNTRY) {

$pass = true;

}

break;

case 'international':

if ($order->delivery['country_id'] != STORE_COUNTRY) {

$pass = true;

}

break;

case 'both':

$pass = true;

break;

}



$free_shipping = false;

if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$free_shipping = true;



include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');

}

} else {

$free_shipping = false;

}



// process the selected shipping method

if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {

if (!tep_session_is_registered('comments')) tep_session_register('comments');

if (tep_not_null($HTTP_POST_VARS['comments'])) {

$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

}



if (!tep_session_is_registered('shipping')) tep_session_register('shipping');



if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {

if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {

$shipping = $HTTP_POST_VARS['shipping'];



list($module, $method) = explode('_', $shipping);

if ( is_object($$module) || ($shipping == 'free_free') ) {

if ($shipping == 'free_free') {

$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;

$quote[0]['methods'][0]['cost'] = '0';

} else {

$quote = $shipping_modules->quote($method, $module);

}

if (isset($quote['error'])) {

tep_session_unregister('shipping');

} else {

if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {

$shipping = array('id' => $shipping,

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),

'cost' => $quote[0]['methods'][0]['cost']);



tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

}

} else {

tep_session_unregister('shipping');

}

}

} else {

$shipping = false;



tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

}

}



// get all available shipping quotes

$quotes = $shipping_modules->quote();



// if no shipping method has been selected, automatically select the cheapest method.

// if the modules status was changed when none were available, to save on implementing

// a javascript force-selection method, also automatically select the cheapest shipping

// method if more than one module is now enabled

if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();



require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);



$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--

var selected;



function selectRowEffect(object, buttonSelect) {

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}



if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;



// one button is not an array

if (document.checkout_address.shipping[0]) {

document.checkout_address.shipping[buttonSelect].checked=true;

} else {

document.checkout_address.shipping.checked=true;

}

}



function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}



function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

//--></script>

<?php echo HTML_PARAMS; ?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"<?php echo CHARSET; ?>

<!-- header_eof //-->



<!-- body //-->

<table width="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top" class="columnLeft"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2" >

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top" class="columnCenter"><?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_delivery.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<?php //start gift registry ?>
<?php
if($cart->registry_customers_id == '0'){
?>
<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION . '<br><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>
<?php
}else{
?>
<td class="main" width="50%" valign="top"><?php echo TEXT_REGISTRY_PURCHASE_SHIPPING_DESTINATION . '<br><br>'; ?></td>
<?php
}
?>
<?php //end gift registry ?>
<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" align="center" valign="top"><?php echo '<b>' . TITLE_SHIPPING_ADDRESS . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" valign="top">
<?php //start gift registry ?>
<?php
if($cart->registry_customers_id == '0'){
echo tep_address_label($customer_id, $sendto, true, ' ', '<br>');
}else{
echo tep_address_label($cart->registry_customers_id, tep_get_default_address($cart->registry_customers_id), true, ' ', '<br>');
}
?>
<?php //end gift registry ?>
</td>
<td class="main" valign="top"><?php echo tep_address_label($customer_id, $sendto, true, ' ', '<br>'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>
<?php
if (tep_count_giftwrap_modules() > 0) {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td height="22" class="main"><b><?php echo TABLE_HEADING_GIFTWRAP_METHOD; ?></b></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td height="194">
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
$quotes1_size = sizeof($quotes1);

if ($quotes1_size > 1) {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_GIFTWRAP_METHOD; ?></td>
<td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<?php
} else {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" width="100%" colspan="2"></td>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<?php
}

$radio_buttons = 0;
for ($i=0; $i<$quotes1_size; $i++) {
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
if (isset($quotes1[$i]['error'])) {
?>
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" colspan="3"><?php echo $quotes1[$i]['error']; ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<?php
} else {
$size = sizeof($quotes1[$i]['methods']);
for ($j=0, $n2=$size; $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
$checked = (($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) ? true : false);

if ( ($quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {
echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
} else {
echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
}
?>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" width="75%"><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>
<?php
if ( ($quotes1_size > 1) || ($n2 > 1) ) {
?>
<td class="main"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>
<td class="main" align="right"><?php echo tep_draw_radio_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id'], $checked); ?></td>

<?php
} else {
?>
<td class="main" align="right" colspan="2"><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']) . tep_draw_hidden_field('giftwrap', $quotes1[$i]['id'] . '_' . $quotes1[$i]['methods'][$j]['id']); ?></td>
<?php
}
?>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<?php
$radio_buttons++;
}
}
?>
</table></td>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
<?php
}
?>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td colspan="2" class="main"><?php echo CATEGORY_RECIPIENT; ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table width="575" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="137" class="main"><?php echo ENTRY_RECPIENT_SEX; ?></td>
<td width="140" class="main"><?php echo tep_draw_input_field('recipient sex','','maxlength="1"' . 'style="width: 50"') . '&nbsp;'(tep_not_null(ENTRY_RECPIENT_SEX_TEXT) ? '<span class="inputRequirement">' . ENTRY_RECPIENT_SEX_TEXT . '</span>': ''); ?></td>
<td width="134" class="main"><?php echo ENTRY_OCCASION; ?></td>
<td width="138" class="main"><?php echo tep_draw_input_field('occasion','','maxlength="40"' . 'style="width: 50"') . '&nbsp;'(tep_not_null(ENTRY_OCCASION_TEXT) ? '<span class="inputRequirement">' . ENTRY_OCCASION_TEXT . '</span>': ''); ?></td>

</tr>
</table></td>

</tr>

</table></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2" class="main"><strong>What do you wish your
gift card to say?</strong></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_textarea_field('gift wrap information', 'soft', '60', '5'); ?></td>
</tr>
</table>
</
td>
</tr>
</table></td>
</tr>
<?php
}
?>
<?php

if (tep_count_shipping_modules() > 0) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?></td>

<td class="main" width="50%" valign="top" align="right"><?php echo '<b>' . TITLE_PLEASE_SELECT . '</b><br>' . tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} elseif ($free_shipping == false) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}



if ($free_shipping == true) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="2" width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><b><?php echo FREE_SHIPPING_TITLE; ?></b>&nbsp;<?php echo $quotes[$i]['icon']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

$radio_buttons = 0;

for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><b><?php echo $quotes[$i]['module']; ?></b>&nbsp;<?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

if (isset($quotes[$i]['error'])) {

?>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><?php echo $quotes[$i]['error']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {

// set the radio button to be checked if it is the method chosen

$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);



if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="75%"><?php echo $quotes[$i]['methods'][$j]['title']; ?></td>

<?php

if ( ($n > 1) || ($n2 > 1) ) {

?>

<td class="main"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>

<td class="main" align="right"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>

<?php

} else {

?>

<td class="main" align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>

<?php

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

$radio_buttons++;

}

}

?>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

}

?>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<b>' . TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>

<td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>


Edited by tec, 17 September 2005 - 06:53.


#48   shaytaan

shaytaan
  • Members
  • 185 posts

Posted 29 September 2005 - 03:38

Is it possible to make something like this?
http://forums.oscomm...t=0#entry711332
,`, God must love stupid people, he made so many ,`,

#49   qhordern

qhordern
  • Members
  • 26 posts

Posted 29 September 2005 - 05:10

This has worked very well.
Now how can i get the new height field to show on my order page??

Q

#50   markschaef

markschaef
  • Members
  • 18 posts

Posted 29 September 2005 - 06:07

Is it possible to make something like this?
http://forums.oscomm...t=0#entry711332


yes, i suppose its not a big deal.
just insert:

<tr><td class="main">Type:</td>
<td class="main"><select name="type" onchange="java script:swap_fields('create');"><option value="2">Firma</option><option value="4">Offentlig</option><option value="1" SELECTED>Privat</option></select></td></tr>

and the javascript command.

I WAS WONDERING, wheater you could use this for the type of account the customer would like to create.
if he only buys DOWNLOAD Products, he probably doesn't want to add all the shipping address stuff..
so maybe we could deactivate certain "field size checks"

thx! yours, Mark

#51   tec

tec
  • Members
  • 580 posts

Posted 29 September 2005 - 14:14

On my check out shipping page, i have the Gift wrap mod installed, if i wanted to add the fields
- Is this for a male or female?
- What is the occassion?
- WHat do you wish the gift card to say?

would i do it the same way but only to the checkout shipping page? and what table would i edit in the DB to add these new fields?

I also need to have it shown on the Admin Orders Status Page and shown within the order confirmation email sent to both customer and store owner.



Should i assume that you cannot put extra fields like the ones above on the check out page?

#52   qhordern

qhordern
  • Members
  • 26 posts

Posted 02 October 2005 - 13:01

Sorry, which code do I need to add in the invoice.php?

How did you go with the added filed for the invoice. I am trying to do the exact same thing . I have tried adding the same fields but it doesnt seem to work.

did you get it to work? if so what did you add to invoice.php?

Q

#53   kdeleon

kdeleon
  • Members
  • 11 posts

Posted 07 October 2005 - 20:43

How did you go with the added filed for the invoice. I am trying to do the exact same thing . I have tried adding the same fields but it doesnt seem to work.

did you get it to work? if so what did you add to invoice.php?

Q


Yes...I would like to know this as well, Thanks!

#54   harky

harky
  • Members
  • 7 posts

Posted 14 February 2006 - 17:53

Oh Great this script is good for a beginner like me.. but can someone teach me how to make my field *REQUIRED?

#55   new-concepts

new-concepts
  • Members
  • 4 posts

Posted 15 March 2006 - 13:05

Hi was hoping somebody could help me.

Can anyone explain how I can add these new fields to the invoice, should have been straightforward but somehow I managed to mess it up and cant get them to show :/

Many Thanks

#56   tec

tec
  • Members
  • 580 posts

Posted 16 April 2006 - 20:43

if i wanted the customer to be able to choose a salutation, would doing what everyone is talking about be the best way to do it?

#57   tec

tec
  • Members
  • 580 posts

Posted 21 April 2006 - 18:26

ok, lets try another one, I want the customer to be able to choose whether or not they would like to put in there middle initial can I do this by following the methods decribed?

#58   Duket

Duket
  • Members
  • 37 posts

Posted 04 May 2006 - 23:32

Hi; I went through the steps but I got this error msgs; 1054 - Unknown column 'customers_CRN' in 'field list'
Can any one help??

#59   julia

julia
  • Members
  • 259 posts

Posted 06 May 2006 - 12:31

Hi; I went through the steps but I got this error msgs; 1054 - Unknown column 'customers_CRN' in 'field list'
Can any one help??


Its been soooo long since I did this, but I do remember getting that error alot...

There are so many places that you can make a misspelling, or interchange the variable name with the wron thing . So..my suggestion would be look very carefuly at ever little change that you made.
Im my case it was always.... that. I added 22 custom fields...
The drop downs are a real treat!
Hope this helps.
Julie

#60   nikmark

nikmark
  • Members
  • 12 posts

Posted 05 July 2006 - 22:08

What if you wanted to add custom form fields. radio buttons, drop down boxes, to the product_info.php page (much like http://drumsforyou.c...?products_id=33 ) and have the form input displayed on the shopping_cart.php page? What pages would you have to edit or modify ? Any help much appreciated
Mark