Thursday 5 April 2012

To check the condition whether the module is installed or uninstalled

To check the condition whether the module is installed or uninstalled to display particular block in tpl file

{if Module::isInstalled("productcomments")}
<div>This block is to be displayed only when module is installed</div>
{/if}
I got PHP notices in Stats tab

Notice: Use of undefined constant _PS_CREATION_DATE_ - assumed '_PS_CREATION_DATE_' in /www/modules/statsforecast/statsforecast.php on line 85


Go to line no:85

Instead of

$from = max(strtotime(_PS_CREATION_DATE_.' 00:00:00'), strtotime($employee->stats_date_from.' 00:00:00')); 

Replace this below code

$from = max(strtotime('_PS_CREATION_DATE_'.' 00:00:00'), strtotime($employee->stats_date_from.' 00:00:00'));