Jcomment form for each product disappears.

  • Posts: 40
  • Thank you received: 2
10 years 6 months ago #179845

-- url of the page with the problem -- : www.thaioptics.com
-- HikaShop version -- : Business 2.1.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.30
-- Browser(s) name and version -- : Firefox 33.0

After I upgraded my Joomla 3.1.5 -> 3.3.6, my jcomment form for each product just disappears !

I have no idea what happened :( so I try to debug the Joomla 3.1.5 comparing to Joomla 3.3.6

I found that the problem comes from components\com_hikashop\views\product\tmpl\show.php

Please note that the -> sign indicates the flow of execution.

	<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
	<?php

->$config = & hikashop_config();
->if ($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->element->product_id && isset ($this->element->main->product_name)){
			$product_id = $this->element->main->product_id;
			$product_name = $this->element->main->product_name;
		}else{
			->$product_id = $this->element->product_id;
			->$product_name = $this->element->product_name;
		}
		->echo JComments::showComments($product_id, 'com_hikashop', $product_name);
	}
}

I found that Joomla 3.1.5 return the right values of $product_id and $product_name while Joomla 3.3.6 returns $product_id = NULL and $product_name = NULL

I think this is the root cause. How do I fix it ? or please correct me if my investigation is wrong. Thank you
( Now, I cannot upgrade to the latest Hikashop Business Version :( )

Last edit: 10 years 6 months ago by eMicroMart.

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

  • Posts: 40
  • Thank you received: 2
10 years 6 months ago #179848

Anyway, why is the coding area just a plain text ? It should be highlighted text.
I have tried code=php but it doesn't work.

Last edit: 10 years 6 months ago by eMicroMart.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #179944

Hi,

Please try to replace:

	$this->params->set('show_price_weight', 0);
	?>
		<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
			<?php

	if (!empty ($this->modules) && is_array($this->modules)) {
		jimport('joomla.application.module.helper');
		foreach ($this->modules as $module) {
			echo JModuleHelper :: renderModule($module);
		}
	}
	?>
		</div>
		<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
		<?php

	$config = & hikashop_config();
	if ($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->element->product_id && isset ($this->element->main->product_name)){
				$product_id = $this->element->main->product_id;
				$product_name = $this->element->main->product_name;
			}else{
				$product_id = $this->element->product_id;
				$product_name = $this->element->product_name;
			}
			echo JComments::showComments($product_id, 'com_hikashop', $product_name);
		}
	}
	elseif ($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->element->product_id && isset ($this->element->main->product_name))
				$product_id = $this->element->main->product_id;
			else
				$product_id = $this->element->product_id;
			echo jomcomment($product_id, 'com_hikashop');
		}
	}
	?>
		</div><?php

}
?>
</div>
By:
	$this->params->set('show_price_weight', 0);
	$this->product = $this->element;
	?>
		<div class="hikashop_submodules" id="hikashop_submodules" style="clear:both">
			<?php
	if (!empty ($this->modules) && is_array($this->modules)) {
		jimport('joomla.application.module.helper');
		foreach ($this->modules as $module) {
			echo JModuleHelper :: renderModule($module);
		}
	}
	?>
		</div>
		<div class="hikashop_external_comments" id="hikashop_external_comments" style="clear:both">
		<?php
	$config = & hikashop_config();
	if ($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 ($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');
		}
	}
	?>
		</div><?php

}
?>
</div>

The following user(s) said Thank You: eMicroMart

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

  • Posts: 40
  • Thank you received: 2
10 years 6 months ago #180051

:woohoo: Wow ... it works ! Thank you so much :woohoo:

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

  • Posts: 40
  • Thank you received: 2
10 years 5 months ago #183239

-- url of the page with the problem -- : www.thaioptics.com
-- HikaShop version -- : Business 2.1.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.30
-- Browser(s) name and version -- : Firefox 33.0

Hello,
I really appreciate your help. Your solution works great to bring the Jcomment form back. However, I have found 2 more problems.

I enable Jcomment throughout my website ( under joomla articles and under products in Hikashop)

The Jcomment forms under all Joomla articles work perfectly. After users had submitted their comments, the Jcomment forms refreshed itself and displayed the comments immediately. After that, I got an email notification for all comments.

Unfortunately, the Jcomment forms under all Hikashop products have a weird behavior. It fails to refresh itself, so users cannot see their comments immediately. Users have to reload the page to see their comments and, more importantly, I don't get any Jcomment email notification, so I don't know my customers ask me a question.

Please feel free to test at www.thaioptics.com

Best regards and Thank you very much

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

  • Posts: 83832
  • Thank you received: 13572
  • MODERATOR
10 years 5 months ago #183262

Hi,

The code of Xavier just loads the Jcomment interface under the product page. It's up to Jcomment itself to refresh itself if necessary and to send the email if necessary. Since we don't know how Jcomment works, we cannot help on these issues.
I would recommend to contact the Jcomment support for help on these questions.

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

Time to create page: 0.080 seconds
Powered by Kunena Forum