Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Out of stock


Tobiel

Recommended Posts

Posted

Hi guys,

 

Everytime someone buys a product in my online store, and thus the product gets out of stock, oscommerce automatically sets it on "out of stock" and thus removes it from the shop. I can ofcourse manually put it on stock again, with the quantity 0, but I'd like oscommerce to just put it at 0 instead of removing it, so that people can always view all my products...

 

I hope you understand my problem and that you have a solution for me, as this is quite important for ym webshop.

Posted

In checkout_process.php try:

 

Find:

 

 if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) 
? ? ? {
? ? ? ? ?$stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];

 

and after add:

 

If ($stock_left < 0) {
$stock_left = 0;
}

 

And change:

 

if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {

 

To:

 

if ( ($stock_left < 0) && (STOCK_ALLOW_CHECKOUT == 'false') ) {

Your online success is Paramount.

Posted

Thank you soooooooooo very much really, this worked perfectly!

 

Thanks again, I REALLY appreciate this! :D

  • 3 months later...
Posted

anyway to get this to not show an add to cart button if the product is out of stock. I too want the products to stay online even when out of stock, but I dont want customers to be able to order them. thanks

Posted

look at the sold out contrib in my signature.

Your online success is Paramount.

Posted

Contrib update:

 

Addition(correction) to query in products_new.php.

Your online success is Paramount.

  • 4 weeks later...
Posted

Hi,

 

I'm editing product_info.php (v 1.97) and I can't find the code:

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

So I can edit it to:

<?php  if ($product_info['products_quantity'] > 0)  { 
  	 echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); 
   }
  	 ?>

 

Am I looking in the wrong file, or do I have an outdated version of product_info.php?

 

Any help is appreciated!

 

Thanks!

Archived

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

×
×
  • Create New...