Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Total module, add a fixed discount code, causes total to go into negatives


evbeej

Recommended Posts

Hello Everyone, 

 

I have been through a lot of forums trying to find a solution to this, and no one else seems to have the same issue I am. 

 

I have order total Discount Code v2.6 installed. 

 

Everything is working fine, except when you enter the code for a set price discount, if the customer is purchasing items that total less then the voucher it makes the total into a negative amount. 

 

ie. 

 

items equal : 62.20

discount:       100.00

vat amount:  10.37

total:              -37.80

 

I have seen on some posts a mention of 'Allow negative order total?' but my version doesnt provide this option.. 

 

is this something i can add to my module? If so, any clues would be a massive help! 

 

Thanks guys! 

Link to comment
Share on other sites

Hi Erika

 

It's gonna be difficult to help without looking at the actual code of that module.

But let's try something...

 

inside your ot_discount.php file you should have the following code around line 96

$order->info['total'] -= $discount;

replace that with the following code provided by marcochiana

if ($discount > $order->info['subtotal']) {
$discount = $order->info['subtotal'];
$order->info['total'] -= $discount;
} else {
$order->info['total'] -= $discount;
} 

Not sure if that will work for you but give it a try and report back. Just make sure to back up that ot_discount.php file just in case.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...