Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

SJ Responsive Content for K2 and JComments problem
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: SJ Responsive Content for K2 and JComments problem

SJ Responsive Content for K2 and JComments problem 9 years, 4 months ago #21982

I use K2 and JComments + K2 JComments plugin on my blog. The number of comments for each item is working fine on core K2 pages (e.g. zatrzymujeczas.pl/warsztat/item/183-hdr-i-mapowanie-tonow-w-fotografii-reportazowej). But when I use SJ Responsive Content for K2, the number of comments is always 0 - have a look at this test page: zatrzymujeczas.pl/test . How can I fix that?

Re: SJ Responsive Content for K2 and JComments problem 9 years, 4 months ago #22052

  • usersmart1
  • OFFLINE
  • Moderator
  • Posts: 1364
  • Karma: 20
Dear cli,

Please feel free to submit a ticket and provide us your admin account.
We will check directly and reply you soon.

Thanks & regards!

Re: SJ Responsive Content for K2 and JComments problem 9 years, 4 months ago #22054

Hi Yennt,

OK, I submitted the ticket.

Re: SJ Responsive Content for K2 and JComments problem 9 years, 4 months ago #22221

Well, I figured out how to do it by myself. Maybe it's not the best solution, but it works.

So you have to edit this file: modules\mod_sj_k2_responsive_content\tmpl\default.php

Go to the line 179 and find this code:

<?php if($params->get('itemCommentsCounter',1) == 1) {?>
<span class="item-comment">
	<?php echo $item->numOfComments; ?>
	<span class="item-comment-bottom"></span>
</span>
<?php }?>


Replace it with:

<?php if($params->get('itemCommentsCounter',1) == 1) {?>
<span class="item-comment">
	<?php
	/**
	 * This section was added to enable use of JComments in Sj Responsive Content for K2
	 * Remember to install K2 JComments plugin first!
	 */
	$commentsAPI = JPATH_SITE . '/components/com_jcomments/jcomments.php';
	if (is_file($commentsAPI)) {
		require_once($commentsAPI);
		$count = JComments::getCommentsCount($item->id, 'com_k2');
		echo $count;}
	else {
		echo $item->numOfComments;} ?>
	<span class="item-comment-bottom"></span>
</span>
<?php }?>
Last Edit: 9 years, 4 months ago by cli.

Re: SJ Responsive Content for K2 and JComments problem 9 years, 4 months ago #22225

  • usersmart1
  • OFFLINE
  • Moderator
  • Posts: 1364
  • Karma: 20
Thank you for your suggestion
Best regards,
  • Page:
  • 1
Time to create page: 0.21 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes