Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

IN STOCK or OUT OF STOCK in product_listing.php version 2.3 Osc


confusedcart

Recommended Posts

Hi guys,

 

In my Osc I sort of have a table showing the manufacture, quantity etc.

 

However for QUANTITY it gives you an amount in stock say 10, or 20 etc.

 

I would like to remove this figure and replace it with a simple IN STOCK or OUT OF STOCK.. And maybe even have a tiny in stock image tickbox

 

My looks like this. It was a customized template so I'm not sure how make changes:

 

for ($col_sort=0, $n=sizeof($column_list); $col_sort<$n; $col_sort++) {
    switch ($column_list[$col_sort]) {
	  case 'PRODUCT_LIST_MODEL':
	    $p_model = '<tr>
   <td><b><font>'.TABLE_HEADING_MODEL.' :</font></b></td>
   <td align="right"><font>' . $listing['products_model'] . '</font></td>
  </tr>';
	    break;
	  case 'PRODUCT_LIST_NAME':
	    if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
	    $p_name = $lc_text = '<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></span>';
	    } else {
	    $p_name = $lc_text = '<span><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></span>';
	    }
	    break;
	  case 'PRODUCT_LIST_MANUFACTURER':
	    $p_manufact = '<tr>
   <td><b><font>'.TABLE_HEADING_MANUFACTURER.' :</font></b></td>
   <td align="right"><font><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a></font></td>
    </tr>';
	    break;
	  case 'PRODUCT_LIST_PRICE':
	    if (tep_not_null($listing['specials_new_products_price'])) {
	   $p_price = $lc_text = '<span class="productSpecialPrice un">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>
 <del>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</del>';
	    } else {
	   $p_price = $lc_text = '<span class="productSpecialPrice">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
	    }
	    break;
	  case 'PRODUCT_LIST_QUANTITY':
	    $p_qty = ' <tr>
   <td><b><font>'.TABLE_HEADING_QUANTITY.' :</font></b></td>
   <td align="right"><font>' . $listing['products_quantity'] . '</font></td>
  </tr>';
	    break;
	  case 'PRODUCT_LIST_WEIGHT':
	    $p_weight = '<tr>
   <td><b><font>'.TABLE_HEADING_WEIGHT.' :</font></b></td>
   <td align="right"><font>' . $listing['products_weight'] . '</font></td>
  </tr>';
	    break;

Link to comment
Share on other sites

Guys i figured it out myself for once!! lol

 

 

case 'PRODUCT_LIST_QUANTITY':

 

if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing['products_id']) < 1)) {

 

$p_qty = $lc_text = '<span class="markProductOutOfStock"><b>Out of Stock</b></span>';

 

} else {

 

$p_qty = $lc_text = '<span class="markProductOutofStock"><b>In Stock</b></span>';

 

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...