Hello!
How do I place a comment counter on the Virtuemar product page in the comments tab, and on the category page? Thanks!
How do I place a comment counter on the Virtuemar product page in the comments tab, and on the category page? Thanks!
<h2 id="jc"><?php echo JText::_ ('COM_VIRTUEMART_COMENTS'); ?><?php
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$options = array();
$options['object_id'] = $this->product->virtuemart_product_id;
$options['object_group'] = 'com_virtuemart';
$options['published'] = 1;
$count = JCommentsModel::getCommentsCount($options);
echo $count = (' ('. $count . ')') ;
} ?></h2>
<?php
require_once(JPATH_ROOT. '/administrator/components/com_komento/includes/komento.php');
$model = KT::model('Comments');
$count = $model->getCount('com_virtuemart', $this->product->virtuemart_product_id);
?>
(<?php echo $count;?>)
<?php
$comments = JPATH_SITE . '/components/com_jcomments/jcomments.php';
if (file_exists($comments)) {
require_once($comments);
$options = array();
$options['object_id'] = $product->virtuemart_product_id;
$options['object_group'] = 'com_virtuemart';
$options['published'] = 1;
$count = JCommentsModel::getCommentsCount($options);
echo $count ? ('Comments: '. $count ) : 'Coment: 0';
}
?>
<?php
require_once(JPATH_ROOT. '/administrator/components/com_komento/includes/komento.php');
$model = KT::model('Comments');
$count = $model->getCount('com_virtuemart', $product->virtuemart_product_id);
?>
Comment (<?php echo $count;?>)