I was wondering if its possible to make a little indicator light, green, yellow or red to indicate stock status in the cart?
0= red out of stock
1-10 yellow low stock
11+ green in stock
See the picture that I did in photoshop
0= red out of stock
1-10 yellow low stock
11+ green in stock
See the picture that I did in photoshop
Attachments
Screen Shot 2014-11-27 at 3.03.31 PM.png (102.06 KiB) Viewed 2910 times
Edit catalog/controller/product/product.php
Before:
Add:
After:
Add:
Edit catalog/view/theme/default/template/product/product.tpl
Find and replace:
With:
Upload images to /image:
- stock_status_red.png
- stock_status_yellow.png
- stock_status_green.png
Before:
Code: Select all
if ($product_info['quantity'] <= 0) {
Code: Select all
if ($product_info['quantity'] > 10) {
$data['stock_indicator'] = 'green';
} else {
$data['stock_indicator'] = 'yellow';
}
Code: Select all
if ($product_info['quantity'] <= 0) {
Code: Select all
$data['stock_indicator'] = 'red';
Find and replace:
Code: Select all
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
Code: Select all
<li><?php echo $text_stock; ?> <?php echo $stock; ?> <img src="image/stock_status_<?php echo $stock_indicator; ?>.png" alt="stock status" /></li>
- stock_status_red.png
- stock_status_yellow.png
- stock_status_green.png
Who is online
Users browsing this forum: Baidu [Spider] and 10 guests