Post by fogma » Thu Sep 04, 2008 4:05 am

A slightly hacky mod (I didn't bother putting the text strings in the language file) to give an indication of stock level on the product page.

In catalog\template\default\content\product.tpl add

Code: Select all

<p><b>Stock Level: <?php echo $stock_level; ?></b></p>
on the line before

Code: Select all

<?php echo $description; ?>
then in catalog\controller\product.php add

Code: Select all

if ($product_info['quantity'] > 5)
{
    $view->set('stock_level', "Plenty");
}
else if ($product_info['quantity'] > 0)
{
    $view->set('stock_level', $product_info['quantity']." Remaining");
}
else
{
    $view->set('stock_level', "Probably Sold Out - Contact us to confirm");
}
on the line before

Code: Select all

$view->set('description', $product_info['description']);
Alternatively if you want to give the exact stock number, then rather than the if statement, just add

Code: Select all

$view->set('stock_level', $product_info['quantity']);
Relevant files have been attached. For an example of it in action, see http://www.ghd-repair.co.uk/shop/

Gary

New member

Posts

Joined
Wed Aug 13, 2008 4:16 am
Who is online

Users browsing this forum: No registered users and 1 guest