Skip to main content

Comments do not show coming from cart (resolved)

More
14 years 3 months ago - 14 years 3 months ago #55267 by esotechie
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: 14 years 3 months ago by esotechie.

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

More
14 years 3 months ago #55351 by nicolas
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.

More
14 years 3 months ago #55394 by esotechie
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.

More
14 years 3 months ago #55431 by esotechie
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.

More
14 years 3 months ago #55449 by Xavier
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:
Code:
$js = ''; $params = null; echo hikashop_getLayout('vote', 'form', $params, $js);
By:
Code:
$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:
Code:
$hikashop_vote_product_id = hikashop_getCID('product_id');
By:
Code:
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.

More
14 years 3 months ago #55451 by esotechie
Thank you Xavier.

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

More
14 years 3 months ago #55458 by esotechie
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.

More
14 years 3 months ago #55464 by esotechie
OK. Got it working.

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

Change
Code:
$js = ''; $params = null; echo hikashop_getLayout('vote', 'form', $params, $js);
to
Code:
$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
Code:
$js = ''; $params = null; echo hikashop_getLayout('vote', 'listing', $params, $js);
to
Code:
$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.

More
14 years 3 months ago #55469 by Xavier
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.250 seconds
Powered by Kunena Forum