Pagination with filters

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
8 years 1 month ago #234769

Hi,

Try changing the code:

class hikashopInStockCheckboxClass extends hikashopFilterTypeClass{
	function display($filter, $divName, &$parent, $datas='', $type='',$tab=''){
		$html='';
		$selected=parent::display($filter, $divName, $parent);
		$checked='';

		if($selected=='in_stock'){
			$checked='checked="checked"';
		}

		$onClick='';
		if($filter->filter_direct_application){
			$onClick='onchange="document.forms[\'hikashop_filter_form_'.$divName.'\'].submit();"';
		}

		$html.= '<span class="hikashop_filter_checkbox"><input '.$onClick.' '.$checked.' type="checkbox" name="filter_'.$filter->filter_namekey.$tab.'" value="in_stock"></span>';
		$html.='<span style="margin-left: 5px;">'.$filter->filter_name.'</span>';
		return $html;
	}
}
to:
class hikashopInStockCheckboxClass extends hikashopFilterTypeClass{
	function display($filter, $divName, &$parent, $datas='', $type='',$tab=''){
		$html = '';
		$selected = parent::display($filter, $divName, $parent);
		$checked = '';
		$value = '';
		
		if($selected=='in_stock'){
			$checked='checked="checked"';
			$value='in_stock';
		}

		if($filter->filter_direct_application){
			$onClick = 'document.forms[\'hikashop_filter_form_'.$divName.'\'].submit();';
		}
		$onClick = 'onchange="var hiddenInput = document.getElementById(\'filter_'.$filter->filter_namekey.$tab.'_hidden\');if(this.checked){ hiddenInput.value=\'in_stock\'; }else{ hiddenInput.value=\'\'; } '.$onClick.'"';

		$html.= '<span class="hikashop_filter_checkbox"><input '.$onClick.' '.$checked.' type="checkbox" name="filter_'.$filter->filter_namekey.$tab.'_checkbox" value="in_stock"><input id="filter_'.$filter->filter_namekey.$tab.'_hidden" type="hidden" name="filter_'.$filter->filter_namekey.$tab.'" value="'.$value.'"></span>';
		$html.='<span style="margin-left: 5px;">'.$filter->filter_name.'</span>';
		return $html;
	}
}
in the file administrator/components/com_hikashop/classes/filter.php and that should help.

The following user(s) said Thank You: shemeck

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

  • Posts: 55
  • Thank you received: 1
8 years 1 month ago #234818

Dear Nicolas,

It works. Thank You. I think we can close this topic.

Is the change for filter.php will be implemented in next versions or I must to remember that?

Kind Regards
SHEMECK

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

  • Posts: 4557
  • Thank you received: 613
  • MODERATOR
8 years 1 month ago #234837

Hello,

Yes this will be implemented in next HikaShop versions and so non need to keep this in mind.

Best regards,

The following user(s) said Thank You: shemeck

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

Time to create page: 0.059 seconds
Powered by Kunena Forum