mc8000 Posted March 6, 2007 Share Posted March 6, 2007 To display stock quantity with some text edit the file includes/modules/product_listing_col.php Change the following line as seen here. I have used the words 'in stock' around line 151 $lc_text = ' ' . $listing[$x]['products_quantity'] . ' in stock'; Link to comment Share on other sites More sharing options...
Guest Posted March 6, 2007 Share Posted March 6, 2007 To display stock quantity with some text edit the file includes/modules/product_listing_col.php Change the following line as seen here. I have used the words 'in stock' around line 151 $lc_text = ' ' . $listing[$x]['products_quantity'] . ' in stock'; Could you help me some more. I have modified the fill, product_listing.php, since I do not have a product_listing_col.php?. But what do I need to do to have the stock displayed together with the name and price? Link to comment Share on other sites More sharing options...
CybrWzrd7 Posted January 11, 2012 Share Posted January 11, 2012 Here is what I did that worked well. I am sure there is a better coding way to do this, but this seems to work fine. case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing[$x]['specials_new_products_price'])) { $lc_text = ' <s>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span> '; } else { if (tep_get_products_stock($listing[$x]['products_id']) < 100 ) $lc_text = 'Inventory: ' . tep_get_products_stock($listing[$x]['products_id']) .'</br>' . ' <font color="black" size="2"><b>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' </font></b>'; if (tep_get_products_stock($listing[$x]['products_id']) > 99 ) $lc_text = 'Inventory: ' . 'Over 100' .'</br>' . ' <font color="black" size="2"><b>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' </font></b>'; if (tep_get_products_stock($listing[$x]['products_id']) < 1 ) $lc_text = 'Inventory: ' . '<font color=red><b>Out Of Stock</b></font>' .'</br>' . ' <font color="black" size="2"><b>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . ' </font></b>'; } break; Link to comment Share on other sites More sharing options...
Guest Posted January 11, 2012 Share Posted January 11, 2012 Chris, You replied to a 5 year old post, that was referring to an out-dated version of osCommerce. Your code refers to v2.3.1 Chris Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.