Hello Richard,
Just combine the code provided by Tony with mine
PHP Code:
namespace XLite\Module\[YOUR_DEV_ID]\[YOUR_MODULE_ID]\View\Product\Details\Customer;
abstract class Stock extends \XLite\View\Product\Details\Customer\Stock implements \XLite\Base\IDecorator
{
protected function isItemsAvailableVisible()
{
return ($this->getProduct()->getInventory()->getAvailableAmount() > 10);
}
protected function getDefaultTemplate()
{
return 'modules/[YOUR_DEV_ID]/[YOUR_MODULE_ID]/product/details/stock/body.tpl';
}
}
This way you keep the widget visible (isVisible() is not modified), but use a different template file that hides the portion of the message when isItemsAvailableVisible() method returns FALSE.
Don't forget to add the modified template to your module.