Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying Total Order Amount On Checkout_Success.php


duncanjones

Recommended Posts

Posted

Hi,

Just wondering, how do i display the total order amount on the checkout_success.php page, and how do i display the order number?

Thanks,

- Duncan

  • 2 months later...
Posted

common sense suggests that there is a piece of code in the checkout_confirmation.php that must be present for your order total to show up, so if you copy and use that code in the checkout_success.php the it will have the same effect... the only downside with that is maybe because the transaction has been completed then it may not show up in the same way if you were to press 'back' in your browser to see the checkout pages once the transaction has been processed.

 

you can always copy and paste (with some modification) the code from admin/orders.php as that will have the call functions

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Posted
Hi,

Just wondering, how do i display the total order amount on the checkout_success.php page, and how do i display the order number?

Thanks,

- Duncan

A, this is something I ca help with... I have direct deposit on my site, so on the checkout_success, I want to display

 

-Customers Last name (for reference)

-Customer total

-All my banking deails (bank name, number, etc...)

 

The code I'm using to do this:

<?php $orders_query = tep_db_query("select orders_id, customers_name, payment_method from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);

echo '<TABLE><TR><TD class="main">' . TEXT_ORDER_NUMER . '</TD><TD class="main">' . $orders['orders_id'] . '</TD></TR><TR><TD class="main">' . TEXT_YOUR_ORDER_TOTAL . '</TD><TD class="main">';
?>
<?php
$orders_query = tep_db_query("select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$customer_id . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' order by orders_id desc limit 1");
while ($orders = tep_db_fetch_array($orders_query)) {
  if (tep_not_null($orders['delivery_name'])) {
	$order_name = $orders['delivery_name'];
	$order_country = $orders['delivery_country'];
  } else {
	$order_name = $orders['billing_name'];
	$order_country = $orders['billing_country'];
  }

  echo $orders['order_total'] . '</TD></TR></TABLE>';
  }
?>

 

There's probably a cleaner way to do this, but it works for me :) Note I used TEXT_YOUR_ORDER_TOTAL and TEXT_ORDER_NUMER - these need to be defined in catalog/includes/languages/endligh/checkout_success.php (just put

define('TEXT_ORDER_NUMBER', 'Order Number: ');

define('TEXT_YOUR_ORDER_TOTAL', 'Your order total: '); before the last ?>).

 

Now for my request - I'm desperatly trying to get this to work ONLY if the customer chooses to pay via Bank Deposit, and can't get the if statement to work - any ideas???

 

Hope this helps you out

 

~Barbara~

Posted

use the payment_method column of the orders table. Extend the sql query to include it

 

("select o.orders_id, o.payment_method, ......

 

Then check it

 

if( $orders['payment_method'] == 'payment method name to check goes here' ) {

// Display order details here

}

Archived

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

×
×
  • Create New...