Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

OTTO if you would try the state thing on my site and it works i can update the contribution with the few bug fixes.i think the problem is solved

 

Cool. Yes, it appears to work fine on your site. Thank you so much. Oh, by the way, if it may take a little while for you to update the contribution, I would really appreciate it if you could just show me what to do to get the state to show up.

Link to comment
Share on other sites

I took a guess that the missing defines in languagues\english\checkout_process.php would be something along these lines:

define('EMAIL_TEXT_INVOICE_PASSWORD', 'To view your invoice you may create an account by following this link:');
define('EMAIL_TEXT_INVOICE_PASSWORD_NOLINK', 'using this password: ');

Link to comment
Share on other sites

david

you have to define these in the language file but i could not comeup for good wording for them

they are to invite the customer to create an account if they have not one is to follow the link and the other one is if the link fails i do not know if the second one is necessary but they can be removed if you do not want them.if you can comeup with some good wording of these please post and i will add it to the next version.

if you are using the paypal contribution of gregory you have to make the same changes that you are making to checkout_process.php to

includes/modules/payment/paypal/classes/osC/Order.class.php

i have followed the guidelines of pwa 0.82 in most of the changes that i made in regard to hiding the account traces if they have a non_account so his recommendation for pwa will work just fine if you use variables that i have used here. what you are trying to do is to remove the link to order in the email if they do NOT have an account and add the invitation. that is all

 

Otto how did you makeout with BTS? did you get it to work and if so can you share what you did?

here is my file of create_account3.php

<?php
/*
 $Id: create+account3.php,v 2.00 2004/01/05 23:28:24 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


 require('includes/application_top.php');
 require(DIR_WS_LANGUAGES . $language . '/' . 'create_account.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
// if we have been here before and are coming back get rid of the credit covers variable
 if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  //rmh M-S_ccgv
//line 21-23 sends the customer ti index.php if he is logedin 
if ((tep_session_is_registered('customer_id'))&&(tep_session_is_registered('createaccount'))) {  tep_redirect(tep_href_link('account_password_new.php', '', 'SSL'));
 }

 if (tep_session_is_registered('customer_id')) {
	 tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
 }

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
 if ($session_started == false) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
 }
 $error = false;
 if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {

  //START REGISTRATION CODE
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);

if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
$city = tep_db_prepare_input($HTTP_POST_VARS['City']);
 if (ACCOUNT_STATE == 'true') {
  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
  if (isset($HTTP_POST_VARS['zone_id'])) {
	$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
  } else {
	$zone_id = false;
  }
}
$country =  tep_db_prepare_input($HTTP_POST_VARS['country']);

$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
$createaccount='N';
if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}
//next two lines gives you a temporary fixed password you can change to what you like
$password = TEMP_PASSWORD;
$confirmation = TEMP_PASSWORD;

$error = false;
if (ACCOUNT_GENDER == 'true') {
  if ( ($gender != 'm') && ($gender != 'f') ) {
	$error = true;

	$messageStack->add('create_account', ENTRY_GENDER_ERROR);
  }
}

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}
//rmh M-S_addr-enhancer begin
if (ACCOUNT_DOB == 'true' && REQUIRE_DOB == 'true') {
  if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
	$error = true;

	$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
  }
}
//rmh M-S_addr-enhancer end
if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
  $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  $check_email = tep_db_fetch_array($check_email_query);

/*  if ($check_email['total'] > 0) {
	$error = true;
	$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
  }*/
if ($check_email['total'] > 0)
{  //PWA delete account
	$get_customer_info = tep_db_query("select customers_id, customers_email_address, createaccount from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
	$customer_info = tep_db_fetch_array($get_customer_info);
	$customer_id = $customer_info['customers_id'];
	$customer_email_address = $customer_info['customers_email_address'];
	$customer_pwa = $customer_info['createaccount'];
	if ($customer_pwa =='Y')
	{
	$error = true;
	$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
	} else {
	// here i am adding another line just incase they change to an account immediatly i do not know if it is necessary or not
		 if (tep_session_is_registered('create_account')) tep_session_unregister('create_account');
		 if (tep_session_is_registered('registered_now')) tep_session_unregister('registered_now');

tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
		tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
	}
  }
// END
}
if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_CITY_ERROR);
}

if (is_numeric($country) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
  $zone_id = 0;
  $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
  $check = tep_db_fetch_array($check_query);
  $entry_state_has_zones = ($check['total'] > 0);
  if ($entry_state_has_zones == true) {
	$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	if (tep_db_num_rows($zone_query) == 1) {
	  $zone = tep_db_fetch_array($zone_query);
	  $zone_id = $zone['zone_id'];
	} else {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
	}
  } else {
	if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR);
	}
  }
}

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}
if ($error == false) {
  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						  'createaccount' => $createaccount,
						  'customers_newsletter' => $newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

  $sql_data_array = array('customers_id' => $customer_id,
						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_postcode' => $postcode,
						  'entry_city' => $city,
						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
  $address_id = tep_db_insert_id();

  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

  tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }

  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');

$registered_now=1;
tep_session_register('registered_now');
tep_session_register('createaccount');

$shipping_address_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);

tep_session_register('billto');
tep_session_register('sendto');
 $billto = $shipping_address['address_book_id'];
 $sendto = $shipping_address['address_book_id'];
  // restore cart contents
  $cart->restore_contents();

  //END REGISTRATION CODE



  //START DIFFERENT SHIPPING CODE

  if (tep_not_null($HTTP_POST_VARS['ShipFirstName']) && tep_not_null($HTTP_POST_VARS['ShipLastName']) && tep_not_null($HTTP_POST_VARS['ShipAddress'])) {
  $process = true;

  $firstname = tep_db_prepare_input($HTTP_POST_VARS['ShipFirstName']);
  $lastname = tep_db_prepare_input($HTTP_POST_VARS['ShipLastName']);
  $street_address = tep_db_prepare_input($HTTP_POST_VARS['ShipAddress']);
  if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['shipsuburb']);
  $postcode = tep_db_prepare_input($HTTP_POST_VARS['shippostcode']);
  $city = tep_db_prepare_input($HTTP_POST_VARS['ShipCity']);
  $country = tep_db_prepare_input($HTTP_POST_VARS['shipcountry']);
  if (ACCOUNT_STATE == 'true') {
	if (isset($HTTP_POST_VARS['zone_id'])) {
	  $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
	} else {
	  $zone_id = false;
	}
	$state = tep_db_prepare_input($HTTP_POST_VARS['shippingstate']);
  }

  if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);
  }

  if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);
  }

  if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_STREET_ADDRESS_ERROR);
  }

  if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);
  }

  if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_CITY_ERROR);
  }

  if (ACCOUNT_STATE == 'true') {
	$zone_id = 0;
	$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
	$check = tep_db_fetch_array($check_query);
	$entry_state_has_zones = ($check['total'] > 0);
	if ($entry_state_has_zones == true) {
	  $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	  if (tep_db_num_rows($zone_query) == 1) {
		$zone = tep_db_fetch_array($zone_query);
		$zone_id = $zone['zone_id'];
	  } else {
		$error = true;

		$messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
	  }
	} else {
	  if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
		$error = true;

		$messageStack->add('checkout_address', ENTRY_STATE_ERROR);
	  }
	}
  }

  if ( (is_numeric($country) == false) || ($country < 1) ) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);
  }
$error = false;
  if ($error == false) {
   $sql_data_array = array('customers_id' => $customer_id,

						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_postcode' => $postcode,
						  'entry_city' => $city,
						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

  $address_id = tep_db_insert_id();
   $sendto =$address_id;
  tep_session_unregister('sendto');
	 // tep_session_unregister('billto');
	  tep_session_register('sendto');
	 // tep_session_register('billto');
	$sendto = tep_db_insert_id();
  //  $billto = $sendto -1;
}
 }
  //END DIFFERENT SHIPPING CODE



  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));
 }
}
 if ($error == true) {
 //  $messageStack->add('create_account', TEXT_CREATE_ACCOUNT_ERROR);
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', '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 src="global.js"type=text/javascript></SCRIPT>
<?php require('includes/form_check.js.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onload="javascripst:document.getElementById('test').innerHTML = unescape(fetch_data());">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><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"><?php echo tep_draw_form('checkout', tep_href_link('create_account3.php', '', 'SSL'), 'post','onSubmit="return check_form(checkout);"') . 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_TITLES; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLES, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>

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


  <tr>
		<td class="main"><?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 TITLE_FORM; ?></b></td>
	  </tr>
	</table></td>
  </tr>
	   <tr>
			<td width="100%" class="main"><?php echo PRIMARY_ADDRESS_DESCRIPTION; ?></td>
	   </tr>

<tr>
	<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TITLE_PAYMENT_ADDRESS; ?></b></td>
	   <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
	  </tr>
<?php
 if ($messageStack->size('create_account') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('create_account'); ?></td>
  </tr>
<?php
}
?>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2" align="right">
	<tr>
		   <td class = "infoBoxContents"><?php echo PAYMENT_SHIPMENT; ?></td>
		   <td class = "infoBoxContents"><input type="image" src="images/collapse_tcat.gif" name="row" value="1" onclick="return toggle_collapse('forumbit_1')"></td>
				</tr>
				</table></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" cellspacing="2" cellpadding="2">
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_FIRST_NAME; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('firstname','','') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_LAST_NAME; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('lastname','','') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_STREET_ADDRESS; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('street_address','','') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>

	<tr>
			<td class="infoBoxContents"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <?php
 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_SUBURB; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>	   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_CITY; ?></td>
		   <td class="infoBoxContents"><?php echo tep_draw_input_field('City') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		</tr>
	  <?php

 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_STATE; ?></td>
			<td class="infoBoxContents">
<?php
if ($HTTP_POST_VARS['action'] == 'process') {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
	while ($zones_values = tep_db_fetch_array($zones_query)) {
	  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	}
	echo tep_draw_pull_down_menu('state', $zones_array);
  } else {
	echo tep_draw_input_field('state');
  }
} else {
  echo tep_draw_input_field('state');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
			</td>
		  </tr>
<?php
 }
?>
	<tr>
			<td class="infoBoxContents"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="infoBoxContents"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
   <tr>

		  <td class="infoBoxContents"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('telephone','','') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
   </tr>
<tr>
			<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': '');?></td>
		  </tr>

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



			 <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2">
				<TBODY id=collapseobj_forumbit_1>
				  <TD class=alt2 noWrap>
				  <table border="0" width="100%" cellspacing="1" cellpadding="2">
					  <TBODY>
						   <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TITLE_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 class="infoBoxContents"><?php echo ENTRY_FIRST_NAME; ?></td>
		   <td class = "infoBoxContents"><input type="text" name="ShipFirstName" value="<? echo $FirstName; ?>" size="20"></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_LAST_NAME; ?></td>
		   <td class = "infoBoxContents"><input name="ShipLastName" value="<? echo $LastName; ?>" size="20"></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_STREET_ADDRESS; ?></td>
		   <td class = "infoBoxContents"><tt><font size="2"><input name="ShipAddress" value="<? echo $ShipAddress; ?>" size="20"></font></tt></td>
   <tr>
			<td class="infoBoxContents"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('shippostcode'); ?></td>
		  </tr>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_CITY; ?></td>
		   <td class="infoBoxContents"><?php echo tep_draw_input_field('ShipCity') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		</tr>
<?php   
	 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_SUBURB; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('shipsuburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }

 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_STATE; ?></td>
			<td class="infoBoxContents">
<?php
if ($HTTP_POST_VARS['action'] == 'process') {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$shipcountry . "' order by zone_name");
	while ($zones_values = tep_db_fetch_array($zones_query)) {
	  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	}
	echo tep_draw_pull_down_menu('shippingstate', $zones_array);
  } else {
	echo tep_draw_input_field('shippingstate');
  }
} else {
  echo tep_draw_input_field('shippingstate');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
			</td>
		  </tr>
<?php
 }
?>
 <tr>
			<td class="infoBoxContents"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="infoBoxContents"><?php echo tep_get_country_list('shipcountry') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
		   <td class="infoBoxContents"><?php echo tep_draw_input_field('shiptelephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
   </tr>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
  </td></tr>
 </TBODY> </table></td>
		  </tr>
		</table></td>
	  </tr>
<script>toggle_collapse('forumbit_1')</script>
<table border="0" width="100%" cellspacing="0" cellpadding="2" valign="top">
<?php
	  if (basename($HTTP_REFERER)) {
?>
	   <td width="20%" valign="top"><center>   <?php
	//   echo '<a href="' . basename($HTTP_REFERER) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?>
<?php
		}
?>
   </td><td width="100%" border="1"> </td><td width="100%" border="1" valign="top"><center>
<?php







 echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form></td>';
?>
</tr></table>
<table border="0" width="100%" cellspacing="0" cellpadding="2" valign="top">
<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>
		<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
			<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	  <tr>
		<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
		<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
	  </tr>

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


<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->

</body>
</html>

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

Link to comment
Share on other sites

So I guess the changes to Greg's order.class.php would be to change:

 

					// lets start with the email confirmation
 $email_order = STORE_NAME . "\n" .
			 EMAIL_SEPARATOR . "\n" .
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $this->orderID . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . $this->accountHistoryInfoURL . "\n" .
			 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 $customerComments = $this->getCustomerComments();

 if ($CustomerComments) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
			  EMAIL_SEPARATOR . "\n" .
			  $products_ordered .
			  EMAIL_SEPARATOR . "\n";

 

to

//fast easy checkout start
//  Add test for no account : no display of invoice URL if no account customer
if (!tep_session_is_registered('createaccount'))
{
 $email_order = STORE_NAME . "\n" .
			 EMAIL_SEPARATOR . "\n" .
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $this->orderID . "\n" .
			 EMAIL_TEXT_INVOICE_URL . ' ' . $this->accountHistoryInfoURL . "\n" .
			 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";

 $customerComments = $this->getCustomerComments();

 if ($CustomerComments) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
			  EMAIL_SEPARATOR . "\n" .
			  $products_ordered .
			  EMAIL_SEPARATOR . "\n";
} else {
 $email_order = STORE_NAME . "\n" .
			 EMAIL_SEPARATOR . "\n" .
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $this->orderID . "\n" .
			 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $order->customer['email_address'] . "' AND createaccount='N'");

 $check_customer = tep_db_fetch_array($check_customer_query);
 $new_password = tep_create_random_value(15);
 $crypted_password = tep_encrypt_password($new_password);

 tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . $crypted_password . "' where customers_id = '" . (int)$check_customer['customers_id'] . "'");

 $email_order .= EMAIL_TEXT_INVOICE_PASSWORD . ' ' . tep_href_link('account_password_new.php', 'confirmation_password=' . $new_password.'&customers_id='.$check_customer['customers_id'], 'SSL', true) . "\n";
 $email_order .= EMAIL_TEXT_INVOICE_PASSWORD_NOLINK. $new_password . "\n";

 if ($order->info['comments']) {
$email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
			  EMAIL_SEPARATOR . "\n" .
			  $products_ordered .
			  EMAIL_SEPARATOR . "\n";
 }
//fast easy checkout end

Link to comment
Share on other sites

yes that should do it

EMAIL_TEXT_INVOICE_PASSWORD_NOLINK was there incase the link don't work

it probably is not necessary.

you can also put a link to account_password_new.php anywhere you want

to enable the non_account customers to create an account like chekout_success.php or header navigation or whereever.

Link to comment
Share on other sites

Actually I think this wording would be better:

 

define('EMAIL_TEXT_INVOICE_PASSWORD', 'If you have changed your mind and would now like to create an account you may do so by following this link:');
define('EMAIL_TEXT_INVOICE_PASSWORD_NOLINK', 'using this password: ');

 

 

and yes you do need the password as the link doesn't seem to login automatically (for me anyway).

 

No tests please our shop is live.

Link to comment
Share on other sites

my idea was that they will be redirected to account_password_new.php which they choose a password and then be able to login after that.

in your case do they get redirected to account_password_new.php

do you see two or three input field?

can customer enter password confirm password and then get redirected to login?

can they login at this stage?

my reasoning was although an account has been created for them they should not know this

they should feel that they are creating an account when they choose a password.

they should not be able to login with the random password at all only when they choose their own password

does that make sence to you

Link to comment
Share on other sites

Yes that seems good. For some reason it is not working that way on my site.

 

They get directed to account_password_new.php where they are asked to enter and confirm a password. (2 fields)

 

They are then told

'Your Current Password did not match the password in our records. Please try again.'

 

A differnt password appears in the url (ending in OIK!)

I tried your site to see if it worked but am still waiting for the email

Edited by radders
Link to comment
Share on other sites

OK, Now I understand what that is all about.

In fact the password in the email link is your key to the new create account screen.

When you get to this screen you should create and confirm a new password.

Then you are still not logged in. You then go to the login screen and enter your email address and newly created password.

 

Will this in ind it would probably would be better not to have anything called password in the email. I have removed the field $new_password from my no account emails and used the following text.

 

define('EMAIL_TEXT_INVOICE_PASSWORD', 'You may create an account by following this link and entering a password of your own choice:');
define('EMAIL_TEXT_INVOICE_PASSWORD_NOLINK', 'You will then be taken to another screen where you can log in to your new account');

Link to comment
Share on other sites

yes that is what i had in mind you can just ask them to greate an account you can not tell them that i have made one for you anyway. right! i hope i am making sense here. open to sugestion ofcourse.

you can also make this page available to non_accounts before thety logout . maybe instead of checkout confirmation ,a link in the header navigation or any where else you like.

i think this is pretty much functional now and very adaptobale.

the only other things i can thinkof

admin capability for which create account to use

adding a login box to create_account3

using java script to make the create account part to appear and disappear

adding process bar to create_account.php like in create_accouint3.php

i guess other cosmetic changes are also possible.

what do you guys think about moving the shipping choices to the top of payment?

Link to comment
Share on other sites

Frank, I gave up on trying to get BTS to work although I'd be interested to find out how if someone has worked it out.

 

As far as showing state in the billing address, I tried to modify my create_account3.php using the one you posted but here's the problem I have currently. In the billing address form, the "State/Province" shows up with a text field (same in the shipping address form). If I specify a state, such as CA along with filling out the rest of the form and continue checking out, it returns to the same form, except this time, it shows the "State/Province" field as a drop-down menu with a list of States. Except that both Alabama and California show up twice. Not only that, in the Shipping Address form area, the State/Province area shows up as an empty drop-down menu.

 

Please please help as I'm stuck. I'm posting my create_account3.php below:

<?php
/*
 $Id: checkout_alternative.php,v 2.00 2004/01/05 23:28:24 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


 require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . 'create_account.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
// if we have been here before and are coming back get rid of the credit covers variable
if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); //rmh M-S_ccgv
//line 21-23 sends the customer ti index.php if he is logedin
if ((tep_session_is_registered('customer_id'))&&(tep_session_is_registered('createaccount'))) { tep_redirect(tep_href_link('account_password_new.php', '', 'SSL'));
}

if (tep_session_is_registered('customer_id')) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL'));
}

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started)
if ($session_started == false) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));
}
$error = false;
if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {

  //START REGISTRATION CODE
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
 $street_address2 = tep_db_prepare_input($HTTP_POST_VARS['street_address2']); //rmh M-S_addr-enhancer
if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
$city = tep_db_prepare_input($HTTP_POST_VARS['City']);
if (ACCOUNT_STATE == 'true') {
$state = tep_db_prepare_input($HTTP_POST_VARS['state']);
if (isset($HTTP_POST_VARS['zone_id'])) {
$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
} else {
$zone_id = false;
}
}
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);	
$country =  tep_db_prepare_input($HTTP_POST_VARS['country']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
$createaccount='N';
if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}
//next two lines gives you a temporary fixed password you can change to what you like
$password = TEMP_PASSWORD;
$confirmation = TEMP_PASSWORD;

$error = false;
if (ACCOUNT_GENDER == 'true') {
if ( ($gender != 'm') && ($gender != 'f') ) {
$error = true;

$messageStack->add('create_account', ENTRY_GENDER_ERROR);
}
}

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}
//rmh M-S_addr-enhancer begin
if (ACCOUNT_DOB == 'true' && REQUIRE_DOB == 'true') {
if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
$error = true;

$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
//rmh M-S_addr-enhancer end
if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
$error = true;

$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$check_email = tep_db_fetch_array($check_email_query);

/* if ($check_email['total'] > 0) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
}*/
if ($check_email['total'] > 0)
{ //PWA delete account
$get_customer_info = tep_db_query("select customers_id, customers_email_address, createaccount from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$customer_info = tep_db_fetch_array($get_customer_info);
$customer_id = $customer_info['customers_id'];
$customer_email_address = $customer_info['customers_email_address'];
$customer_pwa = $customer_info['createaccount'];
if ($customer_pwa =='Y')
{
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
} else {
// here i am adding another line just incase they change to an account immediatly i do not know if it is necessary or not
if (tep_session_is_registered('create_account')) tep_session_unregister('create_account');
if (tep_session_is_registered('registered_now')) tep_session_unregister('registered_now');

tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $customer_id . "'");
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $customer_id . "'");
}
}
// END
}
}
if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_CITY_ERROR);
}

if (is_numeric($country) == false) {
$error = true;

$messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
$zone_id = 0;
$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
$check = tep_db_fetch_array($check_query);
$entry_state_has_zones = ($check['total'] > 0);
if ($entry_state_has_zones == true) {
$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
if (tep_db_num_rows($zone_query) == 1) {
$zone = tep_db_fetch_array($zone_query);
$zone_id = $zone['zone_id'];
} else {
$error = true;

$messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
}
} else {
if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_STATE_ERROR);
}
}
}

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
$error = true;

$messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}
if ($error == false) {
  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						   'createaccount' => $createaccount,
						  'customers_newsletter' => $newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

  $sql_data_array = array('customers_id' => $customer_id,
						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_city' => $city,
						  'entry_postcode' => $postcode,

						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
  $address_id = tep_db_insert_id();

  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

  tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }

  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');

/*

  $customer_group_id = DEFAULT_CUSTOMER_GROUP; //rmh M-S_pricing
  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_billto_address_id = $address_id; //rmh M-S_addr_enhancer
  $customer_shipto_address_id = $address_id; //rmh M-S_addr_enhancer
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  $customer_postcode = $postcode; //rmh M-S_vendor
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_billto_address_id'); //rmh M-S_addr_enhancer
  tep_session_register('customer_shipto_address_id'); //rmh M-S_addr_enhancer
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');
  tep_session_register('customer_group_id'); //rmh M-S_pricing
  tep_session_register('customer_postcode'); //rmh M-S_vendor
 tep_session_register('pizza_style');
 tep_session_register('pizza_mall');
 tep_session_register('store_id');*/
$registered_now=1;
tep_session_register('registered_now');
tep_session_register('createaccount');
$shipping_address_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);
//print_r($shipping_address);
//extract($_POST);

foreach ($_POST as $key => $val) {
		  //echo $key.'<br>';
		  if (!tep_session_is_registered($key)) tep_session_register($key);
		  $$key =$val;
			}
tep_session_register('billto');
tep_session_register('sendto');
 $billto = $shipping_address['address_book_id'];
 $sendto = $shipping_address['address_book_id'];
  // restore cart contents
  $cart->restore_contents();

  //END REGISTRATION CODE


  //START DIFFERENT SHIPPING CODE

  if (tep_not_null($HTTP_POST_VARS['ShipFirstName']) && tep_not_null($HTTP_POST_VARS['ShipLastName']) && tep_not_null($HTTP_POST_VARS['ShipAddress'])) {
  $process = true;

  $firstname = tep_db_prepare_input($HTTP_POST_VARS['ShipFirstName']);
  $lastname = tep_db_prepare_input($HTTP_POST_VARS['ShipLastName']);
  $street_address = tep_db_prepare_input($HTTP_POST_VARS['ShipAddress']);
  //if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['shipstate']);
  $city = tep_db_prepare_input($HTTP_POST_VARS['ShipCity']);
$postcode = tep_db_prepare_input($HTTP_POST_VARS['shippostcode']);	  
$country = tep_db_prepare_input($HTTP_POST_VARS['shipcountry']);
  if (ACCOUNT_STATE == 'true') {
	if (isset($HTTP_POST_VARS['zone_id'])) {
	  $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
	} else {
	  $zone_id = false;
	}
	 $state = tep_db_prepare_input($HTTP_POST_VARS['shippingstate']);
}
  if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_FIRST_NAME_ERROR);
  }

  if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_LAST_NAME_ERROR);
  }

  if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_STREET_ADDRESS_ERROR);
  }

  if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_POST_CODE_ERROR);
  }

  if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_CITY_ERROR);
  }

  if (ACCOUNT_STATE == 'true') {
	$zone_id = 0;
	$check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
	$check = tep_db_fetch_array($check_query);
	$entry_state_has_zones = ($check['total'] > 0);
	if ($entry_state_has_zones == true) {
	  $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	  if (tep_db_num_rows($zone_query) == 1) {
		$zone = tep_db_fetch_array($zone_query);
		$zone_id = $zone['zone_id'];
	  } else {
		$error = true;

		$messageStack->add('checkout_address', ENTRY_STATE_ERROR_SELECT);
	  }
	} else {
	  if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
		$error = true;

		$messageStack->add('checkout_address', ENTRY_STATE_ERROR);
	  }
	}
  }

  if ( (is_numeric($country) == false) || ($country < 1) ) {
	$error = true;

	$messageStack->add('checkout_address', ENTRY_COUNTRY_ERROR);
  }
$error = false;
  if ($error == false) {
   $sql_data_array = array('customers_id' => $customer_id,

						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,

						  'entry_street_address' => $street_address,

						 'entry_city' => $city,
						 'entry_postcode' => $postcode,

						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

  $address_id = tep_db_insert_id();
   $sendto =$address_id;
  tep_session_unregister('sendto');
	  tep_session_unregister('billto');
	  tep_session_register('sendto');
	  tep_session_register('billto');
	$sendto = tep_db_insert_id();
	$billto = $sendto -1;
}
 }
  //END DIFFERENT SHIPPING CODE

  //START PAYMENT CODE



/*
  //START CONFORMITION CODE
  if (!tep_session_is_registered('payment')) tep_session_register('payment');
  if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];

$registered_now=1;
tep_session_register('registered_now');
tep_session_register('createaccount');
if (!tep_session_is_registered('customer_country_id')) tep_session_register('customer_country_id');
if (!tep_session_is_registered('customer_zone_id')) tep_session_register('customer_zone_id');
$customer_country_id = 0;
$customer_zone_id = 0;
  //END CONFORMITION CODE
$order->cart();
$confirmation = $payment_modules->confirmation();
  //print_r($order);
  //$payment_modules = new payment($payment);
*/

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));
}
if ($error == true) {
// $messageStack->add('create_account', TEXT_CREATE_ACCOUNT_ERROR);
}

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', '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 src="global.js"type=text/javascript></SCRIPT>
<?php require('includes/form_check.js.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onload="javascripst:document.getElementById('test').innerHTML = unescape(fetch_data());"><div class="body">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><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"><?php echo tep_draw_form('checkout', tep_href_link('create_account3.php', '', 'SSL'), 'post','onSubmit="return check_form(checkout);"') . 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_TITLES; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_login.gif', HEADING_TITLES, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
	  </tr>
	</table></td>
  </tr>

<?php
 if ($messageStack->size('login') > 0) {

?>
  <tr>
	<td><?php echo $messageStack->output('login'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
 if ($cart->count_contents() > 0) {
?>


<?php
 }
?>

  <tr>
		<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

<tr>










<?php
 ///*********************************** CUSTOMERS MODULE START**************************//////
?>
<tr>
	<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo TITLE_PAYMENT_ADDRESS; ?></b></td>
	   <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></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" cellspacing="2" cellpadding="2" align="right">
	<tr>
		   <td class = "infoBoxContents"><?php echo PAYMENT_SHIPMENT; ?></td>
		   <td class = "infoBoxContents"><input type="image" src="images/collapse_tcat.gif" name="row" value="1" onclick="return toggle_collapse('forumbit_1')"></td>
				</tr>
				</table></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" cellspacing="2" cellpadding="2">
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_FIRST_NAME; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('firstname','','') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_LAST_NAME; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('lastname','','') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_STREET_ADDRESS; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('street_address','','') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>


		  <?php
 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_SUBURB; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>	  <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_CITY; ?></td>
		   <td class = "infoBoxContents"><INPUT TYPE="text" NAME="City" VALUE="<? echo $City; ?>"></td>
   </tr>
<?php

if (ACCOUNT_STATE == 'true') {
?>

<tr>
<td class="infoBoxContents"><?php echo ENTRY_STATE; ?></td>
<td class="infoBoxContents">
<?php
if ($HTTP_POST_VARS['action'] == 'process') {
if ($entry_state_has_zones == true) {
$zones_array = array();
$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
while ($zones_values = tep_db_fetch_array($zones_query)) {
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
}
echo tep_draw_pull_down_menu('state', $zones_array);
} else {
echo tep_draw_input_field('state');
}
} else {
echo tep_draw_input_field('state');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
</td>
</tr>
<?php
}
?>

<tr>
			<td class="infoBoxContents"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
	<tr>
			<td class="infoBoxContents"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="infoBoxContents"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
   <tr>

		  <td class="infoBoxContents"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('telephone','','') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
	<tr>
		  <td class="infoBoxContents"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
		  <td class="infoBoxContents"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
   </tr>
<tr>
			<td class="main"><?php if (STORES_ID>=2)echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php if (STORES_ID>=2)echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': '');?></td>
		  </tr>

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



			 <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2">
				<TBODY id=collapseobj_forumbit_1>
				  <TD class=alt2 noWrap>
				  <table border="0" width="100%" cellspacing="1" cellpadding="2">
					  <TBODY>
						   <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

	  <tr>
		<td class="main"><b><?php echo TITLE_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 class="infoBoxContents"><?php echo ENTRY_FIRST_NAME; ?></td>
		   <td class = "infoBoxContents"><input type="text" name="ShipFirstName" value="<? echo $FirstName; ?>" size="20"></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_LAST_NAME; ?></td>
		   <td class = "infoBoxContents"><input name="ShipLastName" value="<? echo $LastName; ?>" size="20"></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_STREET_ADDRESS; ?></td>
		   <td class = "infoBoxContents"><tt><font size="2"><input name="ShipAddress" value="<? echo $ShipAddress; ?>" size="20"></font></tt></td>
  <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_CITY; ?></td>
		   <td class = "infoBoxContents"><INPUT TYPE="text" NAME="ShipCity" VALUE="<? echo $City; ?>"></td>
   </tr>
<tr>
			<td class="infoBoxContents"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php   
	 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="infoBoxContents"><?php echo ENTRY_SUBURB; ?></td>
			<td class="infoBoxContents"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
}

if (ACCOUNT_STATE == 'true') {
?>
<tr>
<td class="infoBoxContents"><?php echo ENTRY_STATE; ?></td>
<td class="infoBoxContents">
<?php
if ($HTTP_POST_VARS['action'] == 'process') {
if ($entry_state_has_zones == true) {
$zones_array = array();
$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$shipcountry . "' order by zone_name");
while ($zones_values = tep_db_fetch_array($zones_query)) {
$zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
}
echo tep_draw_pull_down_menu('shippingstate', $zones_array);
} else {
echo tep_draw_input_field('shippingstate');
}
} else {
echo tep_draw_input_field('shippingstate');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
</td>
</tr>
<?php
 }
?>
 <tr>
			<td class="infoBoxContents"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="infoBoxContents"><?php echo tep_get_country_list('shipcountry') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
   <tr>
		   <td class="infoBoxContents"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
		   <td class="infoBoxContents"><?php echo tep_draw_input_field('shiptelephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
   </tr>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
  </td></tr>
 </TBODY> </table></td>
		  </tr>
		</table></td>
	  </tr>
<script>toggle_collapse('forumbit_1')</script>
<table border="0" width="100%" cellspacing="0" cellpadding="2" valign="top">
<?php
	  if (basename($HTTP_REFERER)) {
?>
	   <td width="20%" valign="top"><center>   <?php
	   echo '<a href="' . basename($HTTP_REFERER) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?>
<?php
		}
?>
   </td><td width="100%" border="1"> </td><td width="100%" border="1" valign="top"><center>
<?php


echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</form></td>';
?>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="2" valign="top">
<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>
<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
</tr>

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

<!-- body_text_eof //-->
<?php
/*
  <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
  </table></td>
*/
?>
 </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</div>
<br /><br />
</body>
</html>

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

Link to comment
Share on other sites

otto can you use the create_account3.php that i posted in post 205 and see if this works for you. i f not can you ck the demo site and see if you can reproduce the problem

i have cleaned out the file quite a bit so that is the complete file

i also uploaded your file as create_account7.php in the demo site and i can not reproduce the error as you stated any how if i were you i would just use the code on 205 and try that

note that if you misspell the state you get an error with the dropdown but both should be filledout with states not an empty dropdown

Link to comment
Share on other sites

otto can you use the create_account3.php that i posted in post 205 and see if this works for you. i f not can you ck the demo site and see if you can reproduce the problem

i have cleaned out the file quite a bit so that is the complete file

i also uploaded your file as create_account7.php in the demo site and i can not reproduce the error as you stated any how if i were you i would just use the code on 205 and try that

note that if you misspell the state you get an error with the dropdown but both should be filledout with states not an empty dropdown

 

Ok. I just copied your create_account3.php from post 205 and used it as it is exactly but all the same problems still exist. The state field appears as text field at first and when I filll out the form and continue, it returns to the same form and it says:

Error Please select a state from the States pull down menu.

showing a drop down of states (Alabama and California showing twice) and the shipping address showing an empty drop down menu...

 

:(

Link to comment
Share on other sites

I just tried you create_account3.php and everything worked like it should. So... I guess that means the problem lies somewhere else besides my create_account3.php, right? Which file(s) could contain the source of the problem I'm having?

Link to comment
Share on other sites

you might not have a problem

osc handels the state like this

first it displays a field that customer writes the state in

if he makes a mistake a dropdown of available states shows up

now if you misspell one of the states and do not have a state in your second country you will get the error message you will get the us states in one dropdown and nothing in the second dropdown if no states available.

now the problem is that i think it has to show a field when no state but i am not sure

as far as two california and alabama ck if you have two of each in your db

there is a contribution that allows you to have a dropdown from the beginning i have installed something like this and it works. just make sure you have two diffrent name for all the variables if you try to integrate that someone mentioned this at the first three pages of this tread

i will take a look at why it does not give a input field if no state available

i guess it has something with me not changing the name of one of the fields proparly

i t has to ne tommorrow since it is kind of late now

Edited by nana
Link to comment
Share on other sites

Ok. I look forward to an answer to this. I have to admit, I'm not sure what you're referring to when you say,

just make sure you have two diffrent name for all the variables

 

Also, I noticed that when I type in California instead of CA, it returns the same form with a drop down list with "California" selected but with the Zip Code field empty (even though I did type it in before). And retyping the zip code and trying to continue doesn't work as it returns it to the same form with the zip code field empty.

 

Oh, and I just deleted the duplicate california and alabama states. Now when I type in "CA" it returns the same form with Alabama selected with the same empty zip code field problem. When I type in "California" it returns the same form with California with the same empty zip code field problem.

Link to comment
Share on other sites

Hi Frank,

Well so far so good. I have had some real orders now using your contribution.

 

I did manage to reach a situation one time in testing where I had created a billing address but no shipping address. I haven't been able to reproduce that error though.

 

On the functionality I'm fairly happy now. The documentation could do with tidying up a bit :-)

You might get some ideas from the way Greg has done the instructions for his PayPal contribution.

 

Thanks for all your hard work.

David

Link to comment
Share on other sites

glad it is working for you david and thanks for the help i will look at that instruction o see what i can do

otto

can you try your create_account3.phphere is yours

see if you can reproduce the errors

also i have cleaned up the file since you used yours. have you made any other changes other than removing the right column

by diffrent names imean if you decide to use that contribution you should have name of every thing like fields and sql querries and all varuables in billing part and hipping part

Link to comment
Share on other sites

Hi Frank,

 

One thing is puzzling me. Suppose a regular customer has things stored in his shopping cart. He then returns to the site to complete his purchase. How should he do this?

 

Should he add an item to his vistor's cart in order to see the login link? Should he perhaps have bookmarked the login url?

Link to comment
Share on other sites

in mine if they click checkout they go to login/create account.php

i have made a little changes to the top navigation bar last night to have a login and some other stuff i will post it as soon as i get to office

 

 

Hi Frank

 

Great contribution. I've been following this forum intensly and got everything to work so far other than....

 

link from email for non account holder linking to account_password_new.php - user enters password and confirms to create account.

 

i get the following error...

Your Current Password did not match the password in our records. Please try again.

 

im using with hobbs multistore and sts contribs, works great so far.

 

any ideas on the above?

 

thanks

 

 

mark

Link to comment
Share on other sites

here is my header navigation if someone is intrested

<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
<td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <a href="<?php  if (!tep_session_is_registered('createaccount')) {echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; } else {echo tep_href_link('account_password_new.php', '', 'SSL'); ?>" class="headerNavigation"><?php echo 'Create Account'; }  ?></a>  |  <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT, 'fromlogin=1', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN;
?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>  </tr>
</table>

hello mark

as far as your problem let me ask you a couple of questions

is the confirmation code present in the email

make sure that in checkout process you have the code to update the password of the customer to the random value generated

i am using this random password as a validator so the customer that recives the email is the only one that can change the password and create an account in account_password_new.php

also make sure that the confirmation password is in the url

it is a good idea to use the most recent one of this file because i also added the ability to add an account before nonaccounts logout

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...