Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

'Out Of Stock' Message available?


grace819

Recommended Posts

Posted

Hi,

 

I was wondering if anyone knows of any hack for osc which displays an 'out of stock' icon if a particular item has been sold out. I recently changed the quantity in one of my product items to '0' but I was still able to add this to my checkout. This could be quite confusing to some customers and I'd like to find a way to fix this. Can anyone recommend anything? Thanks. :)

Posted

I'm looking for the same thing for the Product Listing in columns (product_listing_col.php) page. Seems no one has ever done this...

 

There is a contribuiton for the Product Listings page ::

http://www.oscommerce.com/community/contributions,641

 

And a hack for the main Product page ::

 

Replace the following in product_info.php:

 

<input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

with the following:

 

<?php 

if (tep_get_products_stock($products_id) > 0) { ?> 

<input type="hidden" name="products_id" value="<?php echo $product_info_values['products_id']; ?>"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> 

<?php } 

else { 

?> 

<em><font color="#999999">Cannot add to cart at this time</font></em><br> 

<?php 

//Comment out the line below...the grey image is still clickable if you do not

//echo tep_image_submit('button_in_cart_grey.gif', 'Cannot add to cart - out of stock')?> 

<?php } ?>

 

 

HTH

Archived

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

×
×
  • Create New...