Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying Product Quantity


CuddlyKingdom

Recommended Posts

Hi all,

 

I've been attempting to install some code that will display the amount quantity in stock. This is done within product_info.php and appears to be working bar one problem. After each of the defined attributes the number “1” appears. I have no idea why this is appearing and any help would be of great help, thanks

 

The code is below

 

<?php

$prod_quantity = tep_get_products_stock($HTTP_GET_VARS['products_id']);

switch ($prod_quantity) {

case 0:

echo print "Out of Stock";

break;

case 1:

echo print "1 in Stock";

break;

case 2:

echo print "2 in Stock";

break;

case 3:

echo print "3 in Stock";

break;

case 4:

echo print "5 in Stock";

break;

default:

echo print "5+ in stock";

}

?>

 

e.g. 5+ in stock1

 

 

thanks for the help

 

Richard

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...