The store that I am webmaster for is using the reward Points module ot_reward_points_discounts. The rewards are a Cash Discount system. For example, 500 pts = $10 discount, 1000 pts = $25 discount, etc. I noticed a couple of flaws with this module. One is that if the discount is larger than the amount of the products ordered, that there is a negative total !! Rather than have this occur, I changed the php code (in ot_reward_points_discounts.php) so that the discount = the amount of the purchase. Here is my coding

function process() {
global $currencies,$order,$messageStack;

// lots of code left out here for simplicity ...

// NEW 04-25-2011: need to handle case when redeemed amount > total of the order
// In this case make the redeemed amount = total of the order
if ($order_discount > $order_total)
{
$order_discount = $order_total;
$messageStack->add_session('checkout_confirmation', "Redeemed Amount used ($" .$order_discount. ") is <b>less than</b> the Available Redeemed Discount ($" .$redeem_discount. ".00) !!", 'caution');

This code is run during Step 2 (Payment) of the Checkout. If the customer had enough reward points, he is shown how much redemption value he has. he can then choose to check that he wants to apply this value to the order. When he hits 'Continue Checkout" it takes him to Step 3 (Confirm) of the Checkout. But when I do this, I don't see the message that I expect from the $messageStack that I set-up ... for example ...
Redeemed Amount used ($14.99) is less than the Available Redeemed Discount ($25.00) !!
Yet if I hit the Browser screen reload button when I am already in Step 3, then I do see the message !!

I suspect this has something to do with the fact that the code has already processed to display the next screen (Step 3) before the customer actually hits the 'Continue Checkout' button. So my message was "stacked" but it was too late to display it ?

I am hoping someone can explain to me what is happening here, and more importantly what can I do make the warning message appear in the very next screen so the customer can see it.