- Posts: 45
- Thank you received: 7
How to change order of comments and related produc
11 years 8 months ago #188170
by Bprak
How to change order of comments and related produc was created 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>
-- 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.
11 years 8 months ago #188207
by Xavier
Replied by Xavier on topic How to change order of comments and related produc
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:
And in the comment part, replace:
By:
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);
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.
11 years 8 months ago #188927
by Bprak
Replied by Bprak on topic How to change order of comments and related produc
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