Make Komento comments as a tab ?

  • Posts: 427
  • Thank you received: 19
7 years 5 months ago #270727

-- HikaShop version -- : 3.1.0

Hi I want to ask komento comments to appear as a tab on the product page (show_tabular.php). I found the code to show the comments now, the goal is to put it on the tab. How can I do it?

<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
<?php
if($this->config->get('comments_feature') == 'jcomments') {
	$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
	if(file_exists($comments)) {
		require_once ($comments);
		if(hikashop_getCID('product_id') != $this->product->product_id && isset($this->product->main->product_name)) {
			$product_id = $this->product->main->product_id;
			$product_name = $this->product->main->product_name;
		} else {
			$product_id = $this->product->product_id;
			$product_name = $this->product->product_name;
		}
		echo JComments::showComments($product_id, 'com_hikashop', $product_name);
	}
} elseif($this->config->get('comments_feature') == 'jomcomment') {
	$comments = HIKASHOP_ROOT . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
	if(file_exists($comments)) {
		require_once ($comments);
		if(hikashop_getCID('product_id') != $this->product->product_id && isset($this->product->main->product_name))
			$product_id = $this->product->main->product_id;
		else
			$product_id = $this->product->product_id;
		echo jomcomment($product_id, 'com_hikashop');
	}
} elseif($this->config->get('comments_feature') == 'komento') {
	$comments = HIKASHOP_ROOT . 'components' . DS . 'com_komento' . DS . 'bootstrap.php';
	if(file_exists($comments)) {
		require_once ($comments);
		echo KT::commentify('com_hikashop', $this->product, array('params' => ''));
	}
}
?>
	</div>

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 5 months ago #270759

Hi,

Our FAQ has documentation on how to add extra tabs to the tabular layout of the product page:
www.hikashop.com/support/documentation/106-faq.html#layo
So do that and move the code in the content of the tab and that should do it.

The following user(s) said Thank You: neo191987

Please Log in or Create an account to join the conversation.

  • Posts: 427
  • Thank you received: 19
7 years 5 months ago #270814

Hi I made the tab it works but Komento does not show up. Note: Komento works under the submodules.



Once the code is placed, nothing appears


Code
<li id="hikashop_show_tabular_external_comments_li" class="hikashop_tabs_li ui-corner-top">
        <?php echo JText::_('PRODUCT_COMMENT');?>
</li>

<div class="hikashop_tabs_content" id="hikashop_show_tabular_external_comments">
        <?php
if($this->config->get('comments_feature') == 'jcomments') {
	$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
	if(file_exists($comments)) {
		require_once ($comments);
		if(hikashop_getCID('product_id') != $this->product->product_id && isset($this->product->main->product_name)) {
			$product_id = $this->product->main->product_id;
			$product_name = $this->product->main->product_name;
		} else {
			$product_id = $this->product->product_id;
			$product_name = $this->product->product_name;
		}
		echo JComments::showComments($product_id, 'com_hikashop', $product_name);
	}
} elseif($this->config->get('comments_feature') == 'jomcomment') {
	$comments = HIKASHOP_ROOT . 'plugins' . DS . 'content' . DS . 'jom_comment_bot.php';
	if(file_exists($comments)) {
		require_once ($comments);
		if(hikashop_getCID('product_id') != $this->product->product_id && isset($this->product->main->product_name))
			$product_id = $this->product->main->product_id;
		else
			$product_id = $this->product->product_id;
		echo jomcomment($product_id, 'com_hikashop');
	}
} elseif($this->config->get('comments_feature') == 'komento') {
	$comments = HIKASHOP_ROOT . 'components' . DS . 'com_komento' . DS . 'bootstrap.php';
	if(file_exists($comments)) {
		require_once ($comments);
		echo KT::commentify('com_hikashop', $this->product, array('params' => ''));
	}
}
?>
        </div>

Attachments:
Last edit: 7 years 5 months ago by neo191987.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 5 months ago #270819

Try to replace $this->product by $this->element in that code.

The following user(s) said Thank You: neo191987

Please Log in or Create an account to join the conversation.

  • Posts: 427
  • Thank you received: 19
7 years 5 months ago #270849

Thanks, everything is fine now.

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum