Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How to ad Sub total to the checkout_success.php page ?


Recommended Posts

Like the topic say

How can I add the Total amount purchased for on the last page.

I have found how to get the order number there but now also needs the rest of the data there.


Point is that customers who order on prepayment can get all the info from last page.


Best Regards


Link to comment
Share on other sites

To clarify

Want it to look like this


Pay to Bank account: 123456-123456

Order number: 1234

Order Total: 150$


Then evrybody that selects prepayment has it easy to hand emedetly to copy paste the information to there internet bank.

Link to comment
Share on other sites

just found your thread when I was looking to solve the same sort of thing (for inserting a sales tracker javascript file); i needed to get the total price on checkout_success.php. I just figured out how to do this and felt like sharing it. This is how I achieved it (comments added to help you):


wherever you want it displayed on checkout_success.php



// need to create an "order" class, so the class def is needed

include(DIR_WS_CLASSES . 'order.php');


// create a new instance of an order, with the order id of the order that has just been processed

$order = new order($orders['orders_id']);


// display the subtotal:

echo "Subtotal: " . $order->totals[0]['text'];


// display the total:

echo "Total: " . $order->totals[1]['text'];




if you look inside the $order array, you'll see that there are the strings "Subtotal:" and "Total:" in there as well; presumably in case different languages are used for different orders (?). so you might want to do this instead:


echo $order->totals[0]['title'] . " " . $order->totals[0]['text'];



you will also note that there is a nugget of oscommerce stupidity here; because the Total value ($order->totals[1]['text'];) contains BOLD tags (wtf) which are actually stored in the database (shrug). So if you're like me and need to use this value for a sales tracker, you'll need to strip them out before you send it off.


No idea about getting the "pay to bank account" value to display; you might need to access the DB directly.

Link to comment
Share on other sites


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

  • Create New...