Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Well, I'm not sure if this is the right forum or not but here's to hoping :D

 

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:

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 :)

Posted
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! :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...