Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

stock reduction help


girl

Recommended Posts

Hi,

Can some one help me. After upteem hours I have discovered that my stock number does not reduce when I have a downlaodable product, BUT reduces when the product is not downloadble. WHY??? And does any one know how to fix it, so the stock quantity will reduce with downaloadble also.

 

The product I wish to sell is in limited quantities so it is important that I get this fixed.

 

Thanks in advance

Link to comment
Share on other sites

I was looking at the code in checkout_process.php

 

It looks as if it's purposely coded to NOT reduce stock if it's a download. Which makes sense in most cases since a "download" isn't normally a "limited" item since after you download it, it's still there.

 

Anyway, in checkout_process.php find this code:

 

// do not decrement quantities if products_attributes_filename exists
	if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
	  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
	} else {
	  $stock_left = $stock_values['products_quantity'];
	}

Change it to this:

 

// do not decrement quantities if products_attributes_filename exists
	if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
	  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
	} else {
	  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];  // changed 14-DEC-07
	}

 

I think that will work to do what you want.

 

You'll need to check because I've never "fixed" this problem before. I'm just making an educated guess based on my interpretation of the code and my coding experience (30+ years).

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

:sweating:

 

:lol:

 

You're most welcome, Ma'am.

:rolleyes:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

:blush:

 

Thank you, Miss Anthony.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...