Hide price of several products

  • Posts: 199
  • Thank you received: 12
  • Hikashop Business
10 years 8 months ago #183693

-- HikaShop version -- : 1410292333
-- Joomla version -- : 3.3.6

Is it possible to hide the price of just several products? (In general I set "Show price" to "yes", but I want to exclude some products because the price differs as it includes custom work.)

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #183696

Hi,

Yes you can by editing for example the view "product / listing_img_title" for the default product listing and add code like:

$toHide = array('1','2','3');
$defShowPrice = $this->params->get('show_price');
if(in_array($this->row->product_id,$toHide)){
     $this->params->set('show_price',0);
}else{
     $this->params->set('show_price',$defShowPrice);
}
After:
if($this->params->get('show_price','-1')=='-1'){
	$config =& hikashop_config();
	$this->params->set('show_price',$config->get('show_price'));
}

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

Time to create page: 0.053 seconds
Powered by Kunena Forum