Skip to main content

Product page voting

More
12 years 4 months ago #155964 by gandalf81
Hi guys,

I need one thing....but I dont know how to do.

I need hide voting stars and "contact us" button on product page, but just for one category. All other products ( in other categories) need have voting stars and contact button.

Thanks

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

More
12 years 4 months ago #156001 by Xavier
Replied by Xavier on topic Product page voting
Hi,

To hide these parts only for one category, you have to edit the view "product / show_default" and add an if condition based on the category around the contact us and vote parts.

An if condition like:
Code:
if($this->element->product_category_id != XX){ // Vote or contact part. }
You have to set the desired category id instead of XX.

ps: the given code need to be between php tags.

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

More
12 years 4 months ago #156056 by gandalf81
Replied by gandalf81 on topic Product page voting
can you be more specific where to put this code. I am not php devolper. Here is part of code I think I need to put code you gave me:

<?php
if(!empty($this->element->extraData->rightBegin))
echo implode("\r\n",$this->element->extraData->rightBegin);
?>
<div id="hikashop_product_vote_mini" class="hikashop_product_vote_mini">
<?php
$config =& hikashop_config();
if($this->params->get('show_vote_product') == '-1'){
$this->params->set('show_vote_product',$config->get('show_vote_product'));
}
if($this->params->get('show_vote_product')){
$js = '';
$this->params->set('vote_type','product');
if(isset($this->element->main)){
$product_id = $this->element->main->product_id;
}else{
$product_id = $this->element->product_id;
}
$this->params->set('vote_ref_id',$product_id);
echo hikashop_getLayout('vote', 'mini', $this->params, $js);
}
?>

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

More
12 years 4 months ago #156088 by Mohamed Thelji
Replied by Mohamed Thelji on topic Product page voting
You'll just have to use the code that Xavier said around these lines for the contact button:
Code:
?> <div id="hikashop_product_contact_main" class="hikashop_product_contact_main"> <?php $contact = $this->config->get('product_contact',0); if (hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty ($this->element->product_contact)))) { $empty = ''; $params = new HikaParameter($empty); global $Itemid; $url_itemid=''; if(!empty($Itemid)){ $url_itemid='&Itemid='.$Itemid; } echo $this->cart->displayButton(JText :: _('CONTACT_US_FOR_INFO'), 'contact_us', $params, hikashop_completeLink('product&task=contact&cid=' . $this->element->product_id.$url_itemid), 'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $this->element->product_id.$url_itemid) . '\';return false;'); } ?> </div> <?php

And around these lines for the vote stars :
Code:
<div id="hikashop_product_vote_mini" class="hikashop_product_vote_mini"> <?php //LAYOUT show the rating stars $config =& hikashop_config(); if($this->params->get('show_vote_product') == '-1'){ $this->params->set('show_vote_product',$config->get('show_vote_product')); } if($this->params->get('show_vote_product')){ $js = ''; $this->params->set('vote_type','product'); if(isset($this->element->main)){ $product_id = $this->element->main->product_id; }else{ $product_id = $this->element->product_id; } $this->params->set('vote_ref_id',$product_id); echo hikashop_getLayout('vote', 'mini', $this->params, $js); } ?> </div>

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

Time to create page: 0.177 seconds
Powered by Kunena Forum