<td class="text-right"><?php if ($product['quantity'] <= 0) { ?>
<span class="label label-warning"><?php echo $product['quantity']; ?></span>
<?php } elseif ($product['quantity'] <= 5) { ?>
<span class="label label-danger"><?php echo $product['quantity']; ?></span>
<?php } else { ?>
<span class="label label-success"><?php echo $product['quantity']; ?></span>
<?php } ?></td>
An idea to avoid further confusion based on the severity order of this functionality would be by replacing the above code from admin/view/template/catalog/product_list.tpl file,
with:
Code: Select all
<td class="text-right"><?php if ($product['quantity'] <= 0) { ?>
<span class="label label-warning" data-toggle="tooltip" title="<?php echo $help_warning; ?>"><?php echo $product['quantity']; ?></span></label>
<?php } elseif ($product['quantity'] <= 5) { ?>
<span class="label label-danger" data-toggle="tooltip" title="<?php echo $help_danger; ?>"><?php echo $product['quantity']; ?></span></label>
<?php } else { ?>
<span class="label label-success" data-toggle="tooltip" title="<?php echo $help_success; ?>"><?php echo $product['quantity']; ?></span></label>
<?php } ?></td>
In admin/controller/catalog/product.php file,
find:
Code: Select all
$this->load->model('design/layout');
add above:
Code: Select all
$data['help_warning'] = $this->language->get('help_warning');
$data['help_danger'] = $this->language->get('help_danger');
$data['help_success'] = $this->language->get('help_success');
Then, in admin/language/<your_language_code>/catalog/product.php file,
add at the bottom:
Code: Select all
$_['help_warning'] = 'Warning';
$_['help_danger'] = 'Danger';
$_['help_success'] = 'Success';
Then, refresh the product list page. Roll-over on those colors with your mouse. This should rectify the issue. In OC v3.x releases, this feature is already part of the core.