Comments do not show coming from cart (resolved)

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55267

In the front-end:
1) View an item - comments are showing OK
2) Add item to to the cart using "Add to cart" button
3) In cart click on the name of the item to return to the item page

Now the item shows with a different URL and the comments are not showing.

Search Engine Friendly URLs is ON

Last edit: 12 years 4 months ago by esotechie.

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
12 years 4 months ago #55351

Hi,

What commenting system are you using ?

Could you give a link so that we can reproduce the problem ?

I tried on our demo website and didn't see the problem.

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55394

Thanks for the reply Nicolas. On your site you do not have Search Engine Friendly URLs turned on. Does it make a difference with it on?

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55431

I've done a little more testing and it does not happen on products without variants. It only occurs if the product has variants.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 4 months ago #55449

Hi,

Thanks for your report. It has been corrected, and will be in the next release.

To fix it:
In HikaShop > Display > Views, Edit the view "product / show_default.php"
And replace:

$js = '';
$params = null;
echo hikashop_getLayout('vote', 'form', $params, $js);
By:
$js = '';
if(isset($this->element->main)){
	$product_id = $this->element->main->product_id;
}else{
	$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'form', $this->params, $js);

In the divs: "hikashop_product_vote_listing" and "hikashop_product_vote_form"

And edit the file:
YourSite\components\com_hikashop\views\vote\view.html.php

And replace:
$hikashop_vote_product_id 	= hikashop_getCID('product_id');
By:
if(!empty($this->params)){
	$hikashop_vote_product_id = $this->params->get('product_id');
}

The following user(s) said Thank You: esotechie

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55451

Thank you Xavier.

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55458

Made the changes now there is no comments at all for any product.

Also there are two occurrences of "$hikashop_vote_product_id = hikashop_getCID('product_id');". Do i change both?

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

  • Posts: 180
  • Thank you received: 13
12 years 4 months ago #55464

OK. Got it working.

There needs to be a bit more clarification on your instructions.

Change

$js = '';
$params = null;
echo hikashop_getLayout('vote', 'form', $params, $js);
to
$js = '';
if(isset($this->element->main)){
	$product_id = $this->element->main->product_id;
}else{
	$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'form', $this->params, $js);

and
$js = '';
$params = null;
echo hikashop_getLayout('vote', 'listing', $params, $js);
to
$js = '';
if(isset($this->element->main)){
	$product_id = $this->element->main->product_id;
}else{
	$product_id = $this->element->product_id;
}
$this->params->set('product_id',$product_id);
echo hikashop_getLayout('vote', 'listing', $this->params, $js);

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

  • Posts: 13201
  • Thank you received: 2322
12 years 4 months ago #55469

Yes, I forgot to specify the two different types of layout.

And you have to change the two different occurrences of: "$hikashop_vote_product_id = hikashop_getCID('product_id');"

The following user(s) said Thank You: esotechie

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

Time to create page: 0.081 seconds
Powered by Kunena Forum