BIG BIG Thanks to JeanJean88
Using the code provided and modified slightly I inserted this into my tpl_product_info_display.php file just after the product price block.
Code:
<!--eof Product Price block -->
<?php
if (zen_get_products_stock((int)$_GET['products_id']) >0) {
$zc_stock_level_image = '<span style="color: #000000; font-size: 12px;">' . In_Stock . '</span>';
}
elseif (zen_get_products_stock((int)$_GET['products_id']) <0) {
$zc_stock_level_image = '<span style="color: #FF0000; font-size: 12px;">' . Temporarily_Out_Of_Stock . '</span>';
}
else {
$zc_stock_level_image = '<span style="color: #FF0000; font-size: 12px;">' . Temporarily_Out_Of_Stock . '</span>';
}
echo '<b class="Stock">Stock Level: </b>' . $zc_stock_level_image;
?>
<!--bof free ship icon -->
You also need to insert into includes/languages/english/YOURTEMPLATE/product_info.php
Code:
define('In_Stock', 'In Stock');
define('Temporarily_Out_Of_Stock', 'Temporarily Out Of Stock - Will Be Dispatched As Soon As Stock Arrives');
Note these are the filenames and descriptions I happened to use - edit them to your own desires.
I used inline definitions of the span styles - the first one for being in stock shows in black - the last two for the out of stocks is in red.
I was not sure why JeanJean88 had the 3 variables - ie >0 , 0 and <0 as I am not familiar with his native language. I have left them in. Currently the <0 and 0 are pointing to the same temporarily out of stock message as all we want is a simple in stock or not in stock decision.
but this could be changed for example to allow for greater than 0 to be in stock - ( knowing you have an inbound delivery of 10 untis ..... ) -1 to -10 to show up as "stock will be shipped early next week" and below -10 to simply be "out of stock - will be shipped as soon as stock arrives"
Bulk of the credit on this to JeanJean88 though - that put me on the right track.
Bookmarks