I did something similar before, I will post that code so you get the idea. My PHP skills aren't that great but it works.
in:
/includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php
find:
PHP Code:
<?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
change to:
PHP Code:
<?php echo (($flag_show_product_info_quantity == 1 && $products_quantity >3) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
<?php
if ($products_quantity == 1) {
echo '<li>' . TEXT_ONE_LEFT . '</li>';
} else {
if ($products_quantity == 2) {
echo '<li>' . TEXT_TWO_LEFT . '</li>';
} else {
if ($products_quantity == 3) {
echo '<li>' . TEXT_THREE_LEFT . '</li>';
}}}
?>
then in:
/includes/languages/english/YOUR_TEMPLATE/product_info.php
Add:
PHP Code:
define('TEXT_ONE_LEFT', 'Are you feeling lucky, only 1 available!');
define('TEXT_TWO_LEFT', 'Don\'t miss out, only 2 left.');
define('TEXT_THREE_LEFT', 'Hurry, while supplies last!');
if the languages file product_info.php doesn't exist, create it.
Hope this helps!
Bookmarks