/** * We display Jcomments tpl, regarding the plugin config and the display config set previously * * @author Florian Voutzinos * @param string $context * @param object reference $product virtuemart product object * @param object reference $params * @param int $limitstart * @return string JComments display */ function onContentAfterDisplay($context, &$product, &$params, $limitstart = 0) { // If the trigger comes from virtuemart productdetails and the plugin is activated in the config if ($context == 'com_virtuemart.productdetails' && $this->params->get('plugin_activated')) { // Do not display comments in modules $data = $params->toArray(); if (isset($data['moduleclass_sfx'])) { return ''; } // Display the comments if enabled if (VmJcommentsHelperPlugin::areCommentsEnabled()) { if (!class_exists('JComments')) { require JCOMMENTS_BASE . '/jcomments.php'; } return JComments::show($product->virtuemart_product_id, 'com_virtuemart', $product->product_name); } return ''; } return ''; }