New Zenner
- Join Date:
- Mar 2011
- Posts:
- 5
- Plugin Contributions:
- 0
Traffic Light Units in Stock indicator
Hi
I have done some searching around the zen cart page and other pages and have partially found an answer to my question. What i want is an traffic light like units in stock indicator on my product_info page. I have found the following code here on the forum
<?php
if (zen_get_products_stock((int)$_GET['products_id']) >1) {
$zc_stock_level_image = '' . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', '', 10, 10) . '';
}
elseif (zen_get_products_stock((int)$_GET['products_id']) <1) {
$zc_stock_level_image = '' . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_red.gif', '', 10, 10) . '';
}
else {
$zc_stock_level_image = '' . zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_yellow.gif', '', 10, 10) . '';
}
echo 'I SEE ' . $zc_stock_level_image;
?>
witten by Ajeh in the follwing thread http://www.zen-cart.com/forum/showthread.php?t=64634
This code does just what i want, but it kinda breaks the zencart code. I would still like to be able to disable this through the admin page and have it in the same css style as productinfo model and weight.
<!--bof Product details list -->
<?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
<ul id="productDetailsList" class="floatingBox back">
<?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li><span class="product-info-label">' . TEXT_PRODUCT_MODEL . '</span>' . $products_model . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li><span class="product-info-label">' . TEXT_PRODUCT_WEIGHT . '</span>' . $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_quantity == 1) ? '<li><span class="product-info-label">'. TEXT_PRODUCT_QUANTITY . '</span>' . $products_quantity . '</li>' : '') . "\n"; ?>
<?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li><span class="product-info-label">' . TEXT_PRODUCT_MANUFACTURER . '</span>' . $manufacturers_name . '</li>' : '') . "\n"; ?>
</ul>
<br class="clearBoth" />
<?php
}
?>
<!--eof Product details list -->
My PHP skills is not that good and and have tried different things, but everything seems to break things in one way or another ;) i would really appreciate if someone could help with an solution, I am pretty sure this would also be appreciated by allot of other people too.
Thanks in advance for any help :)