Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Out of stock


Tobiel

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

  • 4 weeks later...

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!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...