Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

to remove the account_password_new at checkout success just comment

this

if(tep_session_is_registered('createaccount')) tep_redirect(tep_href_link('account_password_new.php','thx=1'));}

to change the wording look in the language files

 

Hi Nana, I have a problem about weight of shipping like previous post. Now I have:

 

Hello,

I go to Admin -> Catalog -> Product expected / Review and have this problem:

 

 

Products Expected

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -20, 20

 

[TEP STOP]

 

 

Reviews

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select reviews_id, products_id, date_added, last_modified, reviews_rating from reviews order by date_added DESC limit -20, 20

 

[TEP STOP]

 

 

 

I used Easy Populate, and Fast Easy Check out contribute.

Anyone help me with this problem? Thank you very much

Link to comment
Share on other sites

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

If I knew more about php I'd spend more time trying to figure this one out myself but way too close to going live to mess it up now.

 

So far with the contributions I have added I have been able to get rid of all references to class="infobox" and class="infoBoxContents" to remove the box color that I don't want in the main body but need in the right and left colimns.

 

I removed PURCHASE WITHOUT ACCOUNT v0.910 to use this Fast & Easy because it also allowed a customer to purchase without an account.

 

My problem now is the coding that I don't understand enough to change it to NOT show any box colors.

Can this code be written so they don't look like this but still work? I think the terms in the code in question are...

 

$loginboxcontent = tep_draw_form

$info_box_contents = array();

new infoBox($info_box_contents);

 

They are in create_account.php

 

Here/s the code starting approx. at line 339

<?php
if($fromlogin!=1){
?>
  <tr>
  <td height="18" class="headerNavigation"><?php echo LOGINBOX_EXISTING_CUSTOMER ?></td>
  </tr>
  <tr>
	<td><?php

$loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'))
								 . '<table width="310" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3" class="smallText">'
							 .'<tr><td class="smallText">'
							 . tep_draw_separator('pixel_trans.gif', '2', '1')
							 . LOGINBOX_EMAIL
							 . '</td><td  class="smallText" colspan="3">'
					 		 . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"')
							 .'</td></tr><tr><td class="smallText">'
							 . tep_draw_separator('pixel_trans.gif', '2', '1')
							 . LOGINBOX_PASSWORD
							 . '</td><td class="smallText">'
							 . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"')
							 . '</td><td class="smallText">'


							 . '</a></td></tr><tr><td class="smallText" colspan="3">'
							 . tep_draw_separator('pixel_trans.gif', '5', '25')
							 . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)
							   . '</form>'
							 . tep_draw_separator('pixel_trans.gif', '5', '1')
							 .  LOGINBOX_TEXT_PASSWORD
							 . '<a href="'
							 . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')
							 . '">'
							 . LOGINBOX_FORGOT_PASSWORD
							 . '</a></td></tr></table><tr>'
							;

$info_box_contents = array();
$info_box_contents[] = array('align' => '',
							 'text'  => $loginboxcontent);
new infoBox($info_box_contents);
?></td>
  </tr>
<?php
}
?>

 

 

Oh and another question for those who are not using the account_password_new.php file at all.

I found this around line 251 in checkout_process.php

email_order .= EMAIL_TEXT_INVOICE_PASSWORD . ' ' . tep_href_link('account_password_new.php',

Do we have to remove the "account_password_new.php" part of that line?

 

I ask because if I act like a customer without a account and click the back button when at the create_account3.php page it takes me to account_password_new.php and I did comment that file out where you told us to before.

 

Thanks....back at it

Karen

Link to comment
Share on other sites

One more thing I just saw.

 

It doesn't matter from where I go to the login page from ....the old page which worked right for me wihout any BOX references now goes to your new page create_account.php so even if I use create_account3.php because that one is short and sweet and doesn't refer to any stuff like new infoBox($info_box_contents); I still end up using create_account.php as the login page anyway.

 

ahh...so close and yet so far away.

 

Hope there is a way around this so I don't have to undo this contribution and redo the PWA.

Time will tell but DH is getting irritated with all the time I've been spending on this, lol.

Edited by giapet
Link to comment
Share on other sites

account_password_new.php is present in few files it presents the customer a second chance to create an account if he chooses not to. this option is presented in the header email and instead of checkout_success,php

if you totaly want to remove this page you have to atleast make changes in these three pages and maybe a redirect to index.php in the file itself incase you miss one

Link to comment
Share on other sites

this contribution is done the way i think is most logical from a customers point of view not a shop owner

if a customer clicks on login or tries to login then by his action he indicates that he is intrested in account and login feature then there is no point in hidding it from him or give him a choice.

on the other hand if the customer simply tries to checkout then we do not want to divert him from making a purchase.

after the purchase we want him to create an account since it would encourage him to come back and also it would make the shop owner's job a lot easier. at this stage the purchase is already made so nothing to lose

hopefully this explains my logic of this checkout process.

PWA is a nice contribution but in my opinion it still diverted the customer from buying to creating account which i did not like at all

Link to comment
Share on other sites

this contribution is done the way i think is most logical from a customers point of view not a shop owner

if a customer clicks on login or tries to login then by his action he indicates that he is intrested in account and login feature then there is no point in hidding it from him or give him a choice.

on the other hand if the customer simply tries to checkout then we do not want to divert him from making a purchase.

after the purchase we want him to create an account since it would encourage him to come back and also it would make the shop owner's job a lot easier. at this stage the purchase is already made so nothing to lose

hopefully this explains my logic of this checkout process.

PWA is a nice contribution but in my opinion it still diverted the customer from buying to creating account which i did not like at all

 

 

My problem has to do with my lack of coding knowledge. I was able to do what I wanted by changing the class="headernavigation" to class="main", it was repeating the header color in the mainbody for some reason.

Thanks for a great contribution!

 

Karen

Link to comment
Share on other sites

thank you

i first explained how to get rid of account_password_new and then i

realized that i might have not explained the logic of the checkout. this would make it easier for everybody to understand what i was trying to do and would make it easier for them to find the code that they would be looking for

 

in the new version i am trying to make things more module so shop owner can easily make this to do what they want it to do as much as possible but i am a little busy now and it is taking a little more than i expected

Edited by nana
Link to comment
Share on other sites

Hi Nana,

 

First, many many thanks for this great contribution and all the support and development you have provided over the months!

 

With respect to the catalog/account_password_new.php page, I completely understand your reason for, and the logic in having this page. Essentially, it provides a customer who inititally sets out to purchase without creating an account to have another opportunity to create an account. Psychologically, during the transaction, the only thing on a customers mind is the product. Many customers are deterred from completing transactions because of being weary about having to create an account and leaving their personal information for, what they deem, longer than necessary with an internet website. Once a transaction is complete, and they have seen how simple and smooth it was to go about their purchase, they may be more likely to consider the option of wanting to create the account! So good thinking on this page Nana!

 

I have also modified the account_password_new.php page by:

 

(1) Replacing the "Continue" button with a "Create Account" button; and

 

(2)changing the "Back" button into a "Log off" button (I have actually called it "End Shopping" button) which essentially ends the session and prevents the loop occuring where a customer clicks on continue without entering a password and is instead presented with the same screen demanding a password.

 

To do this, find the following code in catalog/account_password_new.php:

 

				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
			<td 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>

 

and REPLACE with:

 

				<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image_button('button_end_shopping.gif', 'Click here to log off your shopping session without creating an account') . '</a>'; ?></td>
			<td align="right"><?php echo tep_image_submit('button_create_account.gif', 'Click here to create your account with your requested password'); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

 

Make sure you create the relevant new buttons (i.e. (1) button_end_shopping.gif and (2) button_create_account.gif) and place them in catalog/includes/languages/[your language]/images/buttons/ directory.

 

Then open catalog/includes/languages/[your language]/create_account.php and find:

 

define('ENTRY_CREATEACCOUNT',

 

REPLACE the ENTIRE LINE to:

 

define('ENTRY_CREATEACCOUNT', 'Before you leave, you can create an account with us by simply entering a password of your choice in the boxes below?<br><br>By creating an account you will be able to shop faster, stay up to date with your orders status, and keep track of any orders you may have previously made, and much more!<br><br>If you do not wish to create an account, simply click below on "End Shopping."');

 

You can really add whatever text you want, but I feel it is good to give the customer some blurb as to how to safely exit the store.

 

Hope this helps!

Edited by Unified
Link to comment
Share on other sites

jeff your problem probably have something to do with setting the correct values in your configure file just do a search and there are a few times that this is mentioned along with solution

 

 

Do you have any more specific info? I tried searching for it but I couldn't find anything :(

Link to comment
Share on other sites

my site is at www.graveyardrecords.com/2006/

 

 
<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.graveyardrecords.com/2006/'); // eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://www.graveyardrecords.com/2006/'); // eg, https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', true); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', '.graveyardrecords.com');
 define('HTTPS_COOKIE_DOMAIN', '.graveyardrecords.com');
 define('HTTP_COOKIE_PATH', '/');
 define('HTTPS_COOKIE_PATH', '/');
 define('DIR_WS_HTTP_CATALOG', '/');
 define('DIR_WS_HTTPS_CATALOG', '/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
 define('DIR_FS_DOCUMENT_ROOT', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
 // Wish List 2.3 Start
 define('MAX_DISPLAY_WISHLIST_PRODUCTS', '6'); // How many wishlist items to show per page on the main wishlist.php file
 define('MAX_DISPLAY_WISHLIST_BOX', '4');	  // How many wishlist items to display in the infobox before it changes to a counter
 // Wish List 2.3 End
 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
 define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
// define our database connection
 define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty for productive servers
 define('DB_SERVER_USERNAME', '******');
 define('DB_SERVER_PASSWORD', '******');
 define('DB_DATABASE', '*****');
 define('USE_PCONNECT', 'false'); // use persistent connections?
 define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>

Edited by Graveyard666
Link to comment
Share on other sites

i took this out of one of my demo site it seems to work for me try it to see if it works for you. i do not think the problem is with configuration but nobody else had this problem either i have to go for holiday dinner hope this solves your problem. if not we'll talk tommorrow

 

<?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');
		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;
	}
	$suburb = 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_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

Frank, thanks its working better but now I get this error when I go to confirm the order:

 

Parse error: parse error, unexpected '}' in /home/curtisd/public_html/2006/checkout_process.php on line 268

 

here is my code for checkout_process.php I don't have a way to find line 268

 

<?php
/*
 $Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 include('includes/application_top.php');

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

 if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

// avoid hack attempts during the checkout procedure by checking the internal cartID
 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
if ($cart->cartID != $cartID) {
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
 }
 //added for no account
if (!tep_session_is_registered('createaccount')) 
{$createaccount='Y'; } else {$createaccount='N';} 
 include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

// load selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment($payment);

// load the selected shipping module
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping($shipping);

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

// load the before_process function from the payment modules
 $payment_modules->before_process();

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();
//added an entery for no account here
 $sql_data_array = array('customers_id' => $customer_id,
					  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
					  'customers_company' => $order->customer['company'],
					  'customers_street_address' => $order->customer['street_address'],
					  'customers_suburb' => $order->customer['suburb'],
					  'customers_city' => $order->customer['city'],
					  'customers_postcode' => $order->customer['postcode'], 
					  'customers_state' => $order->customer['state'], 
					  'customers_country' => $order->customer['country']['title'], 
					  'customers_telephone' => $order->customer['telephone'], 
					  'customers_email_address' => $order->customer['email_address'],
					  'customers_address_format_id' => $order->customer['format_id'], 
					  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 
					  'delivery_company' => $order->delivery['company'],
					  'delivery_street_address' => $order->delivery['street_address'], 
					  'delivery_suburb' => $order->delivery['suburb'], 
					  'delivery_city' => $order->delivery['city'], 
					  'delivery_postcode' => $order->delivery['postcode'], 
					  'delivery_state' => $order->delivery['state'], 
					  'delivery_country' => $order->delivery['country']['title'], 
					  'delivery_address_format_id' => $order->delivery['format_id'], 
					  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 
					  'billing_company' => $order->billing['company'],
					  'billing_street_address' => $order->billing['street_address'], 
					  'billing_suburb' => $order->billing['suburb'], 
					  'billing_city' => $order->billing['city'], 
					  'billing_postcode' => $order->billing['postcode'], 
					  'billing_state' => $order->billing['state'], 
					  'billing_country' => $order->billing['country']['title'], 
					  'billing_address_format_id' => $order->billing['format_id'], 
					  'payment_method' => $order->info['payment_method'], 
					  'cc_type' => $order->info['cc_type'], 
					  'cc_owner' => $order->info['cc_owner'], 
					  'cc_number' => $order->info['cc_number'], 
					  'cc_expires' => $order->info['cc_expires'], 
					  'date_purchased' => 'now()', 
					  'orders_status' => $order->info['order_status'], 
					  'currency' => $order->info['currency'],

					  'currency_value' => $order->info['currency_value']);
 tep_db_perform(TABLE_ORDERS, $sql_data_array);
 $insert_id = tep_db_insert_id();
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$sql_data_array = array('orders_id' => $insert_id,
						'title' => $order_totals[$i]['title'],
						'text' => $order_totals[$i]['text'],
						'value' => $order_totals[$i]['value'], 
						'class' => $order_totals[$i]['code'], 
						'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
 }

 $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
 $sql_data_array = array('orders_id' => $insert_id, 
					  'orders_status_id' => $order->info['order_status'], 
					  'date_added' => 'now()', 
					  'customer_notified' => $customer_notification,
					  'comments' => $order->info['comments']);
 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

// initialized for the email confirmation
 $products_ordered = '';
 $subtotal = 0;
 $total_tax = 0;

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
  if (DOWNLOAD_ENABLED == 'true') {
	$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename 
						FROM " . TABLE_PRODUCTS . " p
						LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
						 ON p.products_id=pa.products_id
						LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
						 ON pa.products_attributes_id=pad.products_attributes_id
						WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
	$products_attributes = $order->products[$i]['attributes'];
	if (is_array($products_attributes)) {
	  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
	}
	$stock_query = tep_db_query($stock_query_raw);
  } else {
	$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
  }
  if (tep_db_num_rows($stock_query) > 0) {
	$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
	if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
	  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
	} else {
	  $stock_left = $stock_values['products_quantity'];
	}
	tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
	  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	}
  }
}

// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

$sql_data_array = array('orders_id' => $insert_id, 
						'products_id' => tep_get_prid($order->products[$i]['id']), 
						'products_model' => $order->products[$i]['model'], 
						'products_name' => $order->products[$i]['name'], 
						'products_price' => $order->products[$i]['price'], 
						'final_price' => $order->products[$i]['final_price'], 
						'products_tax' => $order->products[$i]['tax'], 
						'products_quantity' => $order->products[$i]['qty']);
tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
  $attributes_exist = '1';
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
	if (DOWNLOAD_ENABLED == 'true') {
	  $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename 
						   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa 
						   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
							on pa.products_attributes_id=pad.products_attributes_id
						   where pa.products_id = '" . $order->products[$i]['id'] . "' 
							and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' 
							and pa.options_id = popt.products_options_id 
							and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' 
							and pa.options_values_id = poval.products_options_values_id 
							and popt.language_id = '" . $languages_id . "' 
							and poval.language_id = '" . $languages_id . "'";
	  $attributes = tep_db_query($attributes_query);
	} else {
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
	}
	$attributes_values = tep_db_fetch_array($attributes);

	$sql_data_array = array('orders_id' => $insert_id, 
							'orders_products_id' => $order_products_id, 
							'products_options' => $attributes_values['products_options_name'],
							'products_options_values' => $attributes_values['products_options_values_name'], 
							'options_values_price' => $attributes_values['options_values_price'], 
							'price_prefix' => $attributes_values['price_prefix']);
	tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

	if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
	  $sql_data_array = array('orders_id' => $insert_id, 
							  'orders_products_id' => $order_products_id, 
							  'orders_products_filename' => $attributes_values['products_attributes_filename'], 
							  'download_maxdays' => $attributes_values['products_attributes_maxdays'], 
							  'download_count' => $attributes_values['products_attributes_maxcount']);
	  tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
	}
	$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
  }
}
//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
 }

// lets start with the email confirmation
//  Add test for no account : no display of invoice URL if no account customer
//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 . ' ' . $insert_id . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\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";
} else {
$email_order = STORE_NAME . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\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 ,confirmation_key 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 = $check_customer['confirmation_key'];


$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. "\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
} else {
 $email_order = STORE_NAME . "\n" . 
			 EMAIL_SEPARATOR . "\n" . 
			 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\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 ,confirmation_key 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 = $check_customer['confirmation_key'];
  //$crypted_password = tep_encrypt_password($new_password);
 $confirmation=$new_password;
  if (tep_session_is_registered('confirmation')) tep_session_unregister('confirmation');
if (!tep_session_is_registered('confirmation'))tep_session_register('confirmation');
  //   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";
 }
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

 if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . 
				EMAIL_SEPARATOR . "\n" .
				tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
 }

 $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
			  EMAIL_SEPARATOR . "\n" .
			  tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
 if (is_object($$payment)) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
				EMAIL_SEPARATOR . "\n";
$payment_class = $$payment;
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) { 
  $email_order .= $payment_class->email_footer . "\n\n";
}
 }
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }
$email_address=$order->customer['email_address'];
// load the after_process function from the payment modules
 $payment_modules->after_process();

 $cart->reset(true);

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');

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

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

 

Now if I click on my "orders" in the admin I get this error:

 

Parse error: parse error, unexpected T_CASE in /home/curtisd/public_html/2006/admin/orders.php on line 74

 

here is my code for admin/orders.php

 

<?php

/*

$Id: orders.php,v 1.112 2003/06/29 22:50:52 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_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$orders_statuses = array();

$orders_status_array = array();

$orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'");

while ($orders_status = tep_db_fetch_array($orders_status_query)) {

$orders_statuses[] = array('id' => $orders_status['orders_status_id'],

'text' => $orders_status['orders_status_name']);

$orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name'];

}

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

if (tep_not_null($action)) {

switch ($action) {

case 'update_order':

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

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

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

 

$order_updated = false;

//fast easy checkout start

$check_status_query = tep_db_query("select customers_name, customers_email_address,customers_id, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$check_status = tep_db_fetch_array($check_status_query);

$cust_id = $check_status['customers_id'];

//fast easy checkout end

 

if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) {

tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'");

 

$customer_notified = '0';

//fast easy checkout start

if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) {

$notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n";

}

// start no account changes

$noaccount_check_query= tep_db_query("select createaccount from " . TABLE_CUSTOMERS . " where customers_id = '" . $cust_id . "'");

$noaccount_check= tep_db_fetch_array($noaccount_check_query);

if ($noaccount_check['createaccount'] == 'Y'){$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); }

else {$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); } tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

$customer_notified = '1';

}

//fast easy checkout end

 

tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')");

 

$order_updated = true;

}

 

if ($order_updated == true) {

$messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');

} else {

$messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');

}

 

tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit'));

break;

case 'deleteconfirm':

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

tep_remove_order($oID, $HTTP_POST_VARS['restock']);

 

tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action'))));

break;

}

}

 

if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) {

$oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);

 

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$order_exists = true;

if (!tep_db_num_rows($orders_query)) {

$order_exists = false;

$messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');

}

}

 

include(DIR_WS_CLASSES . 'order.php');

?>

<!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>

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

<script language="javascript" src="includes/general.js"></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php

require(DIR_WS_INCLUDES . 'header.php');

?>

<!-- header_eof //-->

 

<!-- body //-->

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

<tr>

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

<!-- left_navigation //-->

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

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

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

<?php

if (($action == 'edit') && ($order_exists == true)) {

$order = new order($oID);

?>

<tr>

<td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

<td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr>

<td colspan="3"><?php echo tep_draw_separator(); ?></td>

</tr>

<tr>

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

<tr>

<td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td>

<td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>

</tr>

<tr>

<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>

</tr>

<tr>

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

<td class="main"><?php echo $order->customer['telephone']; ?></td>

</tr>

<tr>

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

<td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td>

</tr>

</table></td>

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

<tr>

<td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td>

<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td>

</tr>

</table></td>

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

<tr>

<td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td>

<td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td><table border="0" cellspacing="0" cellpadding="2">

<tr>

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

<td class="main"><?php echo $order->info['payment_method']; ?></td>

</tr>

<?php

if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) {

?>

<tr>

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

</tr>

<tr>

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

<td class="main"><?php echo $order->info['cc_type']; ?></td>

</tr>

<tr>

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

<td class="main"><?php echo $order->info['cc_owner']; ?></td>

</tr>

<tr>

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

<td class="main"><?php echo $order->info['cc_number']; ?></td>

</tr>

<tr>

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

<td class="main"><?php echo $order->info['cc_expires']; ?></td>

</tr>

<?php

}

?>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td>

</tr>

<?php

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

echo ' <tr class="dataTableRow">' . "\n" .

' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['name'];

 

if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {

for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {

echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];

if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';

echo '</i></small></nobr>';

}

}

 

echo ' </td>' . "\n" .

' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" .

' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n";

echo ' </tr>' . "\n";

}

?>

<tr>

<td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2">

<?php

for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

echo ' <tr>' . "\n" .

' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" .

' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" .

' </tr>' . "\n";

}

?>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main"><table border="1" cellspacing="0" cellpadding="5">

<tr>

<td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td>

<td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td>

<td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td>

<td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

</tr>

<?php

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

echo ' <tr>' . "\n" .

' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" .

' <td class="smallText" align="center">';

if ($orders_history['customer_notified'] == '1') {

echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n";

} else {

echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n";

}

echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" .

' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" .

' </tr>' . "\n";

}

} else {

echo ' <tr>' . "\n" .

' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" .

' </tr>' . "\n";

}

?>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

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

</tr>

<tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?>

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

</tr>

<tr>

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

</tr>

<tr>

<td><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td>

</tr>

<tr>

<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td>

<td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td>

</tr>

</table></td>

<td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>

</tr>

</table></td>

</form></tr>

<tr>

<td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

</tr>

<?php

} else {

?>

<tr>

<td width="100%"><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_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>

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

<tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?>

<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td>

</form></tr>

<tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?>

<td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td>

</form></tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td>

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

if (isset($HTTP_GET_VARS['cID'])) {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

} elseif (isset($HTTP_GET_VARS['status'])) {

$status = tep_db_prepare_input($HTTP_GET_VARS['status']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id .

Link to comment
Share on other sites

i have an admin/orders.php file posted in the tread you can use that

also use this for checkout_process.php

also try this http://www.mpsoftware.dk/phpdesigner.php

<?php
/*
$Id: checkout_process.php,v 1.128 2003/05/28 18:00:29 hpdl Exp $

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

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

include('includes/application_top.php');

// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}

if (!tep_session_is_registered('sendto')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
if ($cart->cartID != $cartID) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
}
//added for no account
if (!tep_session_is_registered('createaccount'))
{$createaccount='Y'; } else {$createaccount='N';}
include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

// load selected payment module
require(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment($payment);

// load the selected shipping module
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping($shipping);

require(DIR_WS_CLASSES . 'order.php');
$order = new order;

// load the before_process function from the payment modules
$payment_modules->before_process();

require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();
//added an entery for no account here
$sql_data_array = array('customers_id' => $customer_id,
'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
'customers_company' => $order->customer['company'],
'customers_street_address' => $order->customer['street_address'],
'customers_suburb' => $order->customer['suburb'],
'customers_city' => $order->customer['city'],
'customers_postcode' => $order->customer['postcode'],
'customers_state' => $order->customer['state'],
'customers_country' => $order->customer['country']['title'],
'customers_telephone' => $order->customer['telephone'],
'customers_email_address' => $order->customer['email_address'],
'customers_address_format_id' => $order->customer['format_id'],
'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
'delivery_company' => $order->delivery['company'],
'delivery_street_address' => $order->delivery['street_address'],
'delivery_suburb' => $order->delivery['suburb'],
'delivery_city' => $order->delivery['city'],
'delivery_postcode' => $order->delivery['postcode'],
'delivery_state' => $order->delivery['state'],
'delivery_country' => $order->delivery['country']['title'],
'delivery_address_format_id' => $order->delivery['format_id'],
'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
'billing_company' => $order->billing['company'],
'billing_street_address' => $order->billing['street_address'],
'billing_suburb' => $order->billing['suburb'],
'billing_city' => $order->billing['city'],
'billing_postcode' => $order->billing['postcode'],
'billing_state' => $order->billing['state'],
'billing_country' => $order->billing['country']['title'],
'billing_address_format_id' => $order->billing['format_id'],
'payment_method' => $order->info['payment_method'],
'cc_type' => $order->info['cc_type'],
'cc_owner' => $order->info['cc_owner'],
'cc_number' => $order->info['cc_number'],
'cc_expires' => $order->info['cc_expires'],
'date_purchased' => 'now()',
'orders_status' => $order->info['order_status'],
'currency' => $order->info['currency'],

'currency_value' => $order->info['currency_value']);
tep_db_perform(TABLE_ORDERS, $sql_data_array);
$insert_id = tep_db_insert_id();
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$sql_data_array = array('orders_id' => $insert_id,
'title' => $order_totals[$i]['title'],
'text' => $order_totals[$i]['text'],
'value' => $order_totals[$i]['value'],
'class' => $order_totals[$i]['code'],
'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
}

$customer_notification = (SEND_EMAILS == 'true') ? '1' : '0';
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $order->info['order_status'],
'date_added' => 'now()',
'customer_notified' => $customer_notification,
'comments' => $order->info['comments']);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);

// initialized for the email confirmation
$products_ordered = '';
$subtotal = 0;
$total_tax = 0;

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
if (STOCK_LIMITED == 'true') {
if (DOWNLOAD_ENABLED == 'true') {
$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
ON p.products_id=pa.products_id
LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
ON pa.products_attributes_id=pad.products_attributes_id
WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
$products_attributes = $order->products[$i]['attributes'];
if (is_array($products_attributes)) {
$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
}
$stock_query = tep_db_query($stock_query_raw);
} else {
$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
if (tep_db_num_rows($stock_query) > 0) {
$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
} else {
$stock_left = $stock_values['products_quantity'];
}
tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
}
}
}

// Update products_ordered (for bestsellers list)
tep_db_query("update " . TABLE_PRODUCTS . " set products_ordered = products_ordered + " . sprintf('%d', $order->products[$i]['qty']) . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");

$sql_data_array = array('orders_id' => $insert_id,
'products_id' => tep_get_prid($order->products[$i]['id']),
'products_model' => $order->products[$i]['model'],
'products_name' => $order->products[$i]['name'],
'products_price' => $order->products[$i]['price'],
'final_price' => $order->products[$i]['final_price'],
'products_tax' => $order->products[$i]['tax'],
'products_quantity' => $order->products[$i]['qty']);
tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);
$order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
$attributes_exist = '0';
$products_ordered_attributes = '';
if (isset($order->products[$i]['attributes'])) {
$attributes_exist = '1';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
if (DOWNLOAD_ENABLED == 'true') {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
on pa.products_attributes_id=pad.products_attributes_id
where pa.products_id = '" . $order->products[$i]['id'] . "'
and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
and pa.options_id = popt.products_options_id
and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
and pa.options_values_id = poval.products_options_values_id
and popt.language_id = '" . $languages_id . "'
and poval.language_id = '" . $languages_id . "'";
$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);

$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'products_options' => $attributes_values['products_options_name'],
'products_options_values' => $attributes_values['products_options_values_name'],
'options_values_price' => $attributes_values['options_values_price'],
'price_prefix' => $attributes_values['price_prefix']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);

if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {
$sql_data_array = array('orders_id' => $insert_id,
'orders_products_id' => $order_products_id,
'orders_products_filename' => $attributes_values['products_attributes_filename'],
'download_maxdays' => $attributes_values['products_attributes_maxdays'],
'download_count' => $attributes_values['products_attributes_maxcount']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
}
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
}
}
//------insert customer choosen option eof ----
$total_weight += ($order->products[$i]['qty'] * $order->products[$i]['weight']);
$total_tax += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty'];
$total_cost += $total_products_price;

$products_ordered .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n";
}

// lets start with the email confirmation
// Add test for no account : no display of invoice URL if no account customer
//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 . ' ' . $insert_id . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\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";
} else {
$email_order = STORE_NAME . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\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 ,confirmation_key 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 = $check_customer['confirmation_key'];
$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. "\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
//} else {
$email_order = STORE_NAME . "\n" .
EMAIL_SEPARATOR . "\n" .
EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\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 ,confirmation_key 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 = $check_customer['confirmation_key'];
//$crypted_password = tep_encrypt_password($new_password);
$confirmation=$new_password;
if (tep_session_is_registered('confirmation')) tep_session_unregister('confirmation');
if (!tep_session_is_registered('confirmation'))tep_session_register('confirmation');
// 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";
}
for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
}

if ($order->content_type != 'virtual') {
$email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n";
}

$email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
EMAIL_SEPARATOR . "\n" .
tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
if (is_object($$payment)) {
$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
EMAIL_SEPARATOR . "\n";
$payment_class = $$payment;
$email_order .= $payment_class->title . "\n\n";
if ($payment_class->email_footer) {
$email_order .= $payment_class->email_footer . "\n\n";
}
}
tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people
if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
$email_address=$order->customer['email_address'];
// load the after_process function from the payment modules
$payment_modules->after_process();

$cart->reset(true);

// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');

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

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

Link to comment
Share on other sites

eww try dong this
 //<?php echo $payment_modules->javascript_validation(); ?>

to

<?php //echo $payment_modules->javascript_validation(); ?>

 

is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));

to

/*is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));*/

 

craig try reading post 580 in last page also try to look for the codes that look like what i mentioned to eww these are the ones to comment out so you do not get kicked back they are in checkout_shipping and checkout_confirmation.php someone explained how to set products as virtual somewhere in this tread but there might be easier to search the forum or ....

 

with that, i get:

Parse error: parse error, unexpected ';' in /home/**/public_html/checkout_shipping.php on line 102

 

 

and on line 102:

tep_session_unregister('payment');

Link to comment
Share on other sites

lines 90 to 110:

tep_session_unregister('billing');
tep_session_unregister('payment');
if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];
if (!tep_session_is_registered('payment')) tep_session_register('payment');




if($n==1){
if ( ( /*is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));*/

tep_session_unregister('payment');
$payment_modules->update_status();
}
if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
}
}
while (list($key, $value) = each($_POST))
{

Edited by eww
Link to comment
Share on other sites

try this

tep_session_unregister('billing');
tep_session_unregister('payment');
if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];
if (!tep_session_is_registered('payment')) tep_session_register('payment');




if($n==1){
/*if ( (is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));

tep_session_unregister('payment');
$payment_modules->update_status();
}*/
if (is_array($payment_modules->modules)) {
$payment_modules->pre_confirmation_check();
}
}
while (list($key, $value) = each($_POST))
{

Link to comment
Share on other sites

Hi all

 

I have just replaced all the contrib files on my shop with the last most up to date version, and though it all appears to work fine,

 

I am not able to view any orders placed in admin, though the main adminscreen tells me there are orders pending.

 

Whats going on with this, can anyone help, the shop goes live in days.

 

pelase help

Born - Scotland

Location - Kent, England

Job - hunting for one

Link to comment
Share on other sites

if you add this code somewhere in the page maybe before the block of commentd

then start a sale go all the way to checkout confirmation and then go back to the shiipping page and see if the totals are correct

 <tr class="infoBoxContents" >
	<td align-"right><table border="0" width="100%" cellspacing="1" cellpadding="2" align-"center"   class="infoBox"><tr class="infoBoxContents"><td>
<table border="0" width="100%" cellspacing="1" cellpadding="2" align-"center"   class="infoBoxcontent"  >


<?php

 if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_total_modules->process();
echo $order_total_modules->output();
 }

 if (is_array($payment_modules->modules)) {
if ($confirmation = $payment_modules->confirmation()) {

?>
<?php
  for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
?>
		  <tr  class="infoBoxContents"  align="right">
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td>
		  </tr>
<?php
  } } }


$html = '<input type="submit" name="action" value="Add" />';


?>

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

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.

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...