Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Details on checkout_success page


Larry Parker

Recommended Posts

Posted

Hello,

 

Would anyone out there happen to know how I could

display the order details onto the checkout_success page

 

(billing address, shipping address, products ordered with pricing,

payment method, and, of course, the order payment info.)

 

I think this is pretty important, since many customers will want

to wait for their order to be finalized before printing out or

"saving to file" the details. The way the cart is set up, though,

all they see on checkout_success is "Okay, thanks. We love you and have a nice day."

 

They, of course, have the option of clicking on a link that takes them to their

order history, but I'd like to save them that extra step, if possible.

 

Any input would be appreciated.

 

Thanks,

 

Larry Parker

www.vanguardoffice.com

  • 1 year later...
Posted
So did you ever find a way to do this? I am looking for the same thing, and having no luck :S

Print Order receipt add on. Besides, aren't those details on the confirm order page?

Posted
Print Order receipt add on. Besides, aren't those details on the confirm order page?

 

Try this,

 

In checkout_success.php, add where you wantot display the order details

 

<?php include('account_history_info_success.php'); ?>

 

Then copy the following code to a new file, and save as catalog/account_history_info_success.php

 

<?php
/*
 $Id: account_history_info.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 2007 osCommerce

 Released under the GNU General Public License
*/


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


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

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

  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main" colspan="2"><b><?php echo sprintf(HEADING_ORDER_NUMBER, $orders['orders_id']) . ' <small>(' . $order->info['orders_status'] . ')</small>'; ?></b></td>
	  </tr>
	  <tr>
		<td class="smallText"><?php echo HEADING_ORDER_DATE . ' ' . tep_date_long($order->info['date_purchased']); ?></td>
		<td class="smallText" align="right"><?php echo HEADING_ORDER_TOTAL . ' ' . $order->info['total']; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
<?php
 if ($order->delivery != false) {
?>
		<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main"><b><?php echo HEADING_DELIVERY_ADDRESS; ?></b></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>
		  </tr>
<?php
if (tep_not_null($order->info['shipping_method'])) {
?>
		  <tr>
			<td class="main"><b><?php echo HEADING_SHIPPING_METHOD; ?></b></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo $order->info['shipping_method']; ?></td>
		  </tr>
<?php
}
?>
		</table></td>
<?php
 }
?>
		<td width="<?php echo (($order->delivery != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
		  <tr>
			<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (sizeof($order->info['tax_groups']) > 1) {
?>
			  <tr>
				<td class="main" colspan="2"><b><?php echo HEADING_PRODUCTS; ?></b></td>
				<td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>
				<td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
			  </tr>
<?php
 } else {
?>
			  <tr>
				<td class="main" colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td>
			  </tr>
<?php
 }

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
echo '		  <tr>' . "\n" .
	 '			<td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	 '			<td class="main" valign="top">' . $order->products[$i]['name'];

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
	echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
  }
}

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

if (sizeof($order->info['tax_groups']) > 1) {
  echo '			<td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
}

echo '			<td class="main" align="right" valign="top">' . $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']) . '</td>' . "\n" .
	 '		  </tr>' . "\n";
 }
?>
			</table></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td class="main"><b><?php echo HEADING_BILLING_ADDRESS; ?></b></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>
		  </tr>
		  <tr>
			<td class="main"><b><?php echo HEADING_PAYMENT_METHOD; ?></b></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo $order->info['payment_method']; ?></td>
		  </tr>
		</table></td>
		<td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
echo '			  <tr>' . "\n" .
	 '				<td class="main" align="right" width="100%">' . $order->totals[$i]['title'] . '</td>' . "\n" .
	 '				<td class="main" align="right">' . $order->totals[$i]['text'] . '</td>' . "\n" .
	 '			  </tr>' . "\n";
 }
?>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo HEADING_ORDER_HISTORY; ?></b></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$orders['orders_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' and os.public_flag = '1' order by osh.date_added");
 while ($statuses = tep_db_fetch_array($statuses_query)) {
echo '			  <tr>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . tep_date_short($statuses['date_added']) . '</td>' . "\n" .
	 '				<td class="main" valign="top" width="70">' . $statuses['orders_status_name'] . '</td>' . "\n" .
	 '				<td class="main" valign="top">' . (empty($statuses['comments']) ? ' ' : nl2br(tep_output_string_protected($statuses['comments']))) . '</td>' . "\n" .
	 '			  </tr>' . "\n";
 }
?>
		</table></td>
	  </tr>
	</table>

	</td>
  </tr>
<?php
 if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php');
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>

</table>

 

This should give the information and output you are looking for :thumbsup:

Posted

Another Option:

 

tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$orders['orders_id'], 'SSL'));

 

Completely untested. Add it after: $orders = tep_db_fetch_array($orders_query); in checkout_success.php

 

Obviously you'd want to put a bit extra verbage in the account_history_info page to let them know their order is successful and here's a summary of it, and it'll be posted out within a day or two (or whatever).

 

Gary

Posted
Another Option:

 

tep_redirect(tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$orders['orders_id'], 'SSL'));

 

Completely untested. Add it after: $orders = tep_db_fetch_array($orders_query); in checkout_success.php

 

Obviously you'd want to put a bit extra verbage in the account_history_info page to let them know their order is successful and here's a summary of it, and it'll be posted out within a day or two (or whatever).

 

Gary

Thank you it also helped me out, thank you very much

  • 2 weeks later...
Posted

I just tried this and it works BUT, checkout_success.php shows all the correct order information except a product that no longer exists in the catalogue!

Basically it displays the first order made details and doesn't update to the current order, although it shows all the other correct details, order number etc.

When I deleted this first order and made another order, all of the order information disappeared.

 

Any idea why?

 

Sorry I should have said that I tried box25's solution.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...