OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Percentage Discount
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Contributions / Add-Ons > Order Total Modules
mematrix
Well, I'm not sure if this is the right forum or not but here's to hoping biggrin.gif

Anywho, I'm trying to code this referral system, where if a valid referer is selected, then the customer receives a 5% discount off the subtotal.
Basically I figured setting in the checkout_confirmation.php page an isset along the lines of this:
CODE
if (isset($order->info['rep']) && $order->info['rep'] > 0)
{
$order->info['subtotal'] = $order->info['subtotal'] * 0.95;
}


On the actual confirmation page, it displays the new value just fine. I also have it run in the checkout_process.php page, but for some reason, between processing it, and inserting the order into the DB, the lowered value is lost and the original subtotal is set.

Any ideas as to what I'm doing wrong or how I would go about getting the effect I"m looking for?

Thanks all smile.gif
Jack_mcs
Changing the order like that isn't a simple process. Try installing the Easy Discount contribution. It will do what you want.

Jack
mematrix
QUOTE (Jack_mcs @ Mar 31 2008, 12:52 PM) *
Changing the order like that isn't a simple process. Try installing the Easy Discount contribution. It will do what you want.

Jack

Thanks, that worked pleasantly! smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.