Skip to main content

How to change order of comments and related produc

More
11 years 8 months ago #188170 by Bprak
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Hello,
How can I change order of comments on product? I want to change order of related products and comments – related product first, comments second – comments after related products.
I have edited a product / show.php file. When I had changed order of code that you see below, comment form was moved after related product, but when I add a comment, product ID was not assigned, so my new comment was displayed on every product in shop. I also see that parm “hikashop_vote_ref_id” after that change is null.



<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>

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

More
11 years 8 months ago #188207 by Xavier
Hi,

That's potentially because the value is edited in the module.
What can be done is to add this code before the submodules one:
Code:
if(isset($this->element->main)){ $product_id = $this->element->main->product_id; }else{ $product_id = $this->element->product_id; } $tmpVar = $product_id;

And in the comment part, replace:
Code:
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);
By:
Code:
$this->params->set('product_id',$tmpVar);
The following user(s) said Thank You: Bprak

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

More
11 years 8 months ago #188927 by Bprak
Hi, thank You for help, it is working! I replace code in two places in thaht script

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

Time to create page: 0.158 seconds
Powered by Kunena Forum