A few questions with filters and search

  • Posts: 490
  • Thank you received: 2
6 years 9 months ago #272199

-- HikaShop version -- : 32.6.4
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

1. everytime i make a search on the text search filter the url always has this /product/listing? can this be changed respective of the category?

2. can the filters behave universally? i mean can it work for all? example i created a sort filter. can this work for all menus? sub menu?. The way its working now is that the filters will only work properly based on the menu id added on the Hikashop Filtering Module.

3. there is a category filter. i have managed to display the main categories but not the sub category. how can i display the subcategory together with the main category.

Last edit: 6 years 9 months ago by ronron.

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
6 years 9 months ago #272207

Hi,

1. That's how it is. You can change the code:

$url = hikashop_currentURL();
	if(!empty($this->params) && $this->params->get('module') == 'mod_hikashop_filter' && ($this->params->get('force_redirect',0) || (JRequest::getVar('force_using_filters', 0) !== 1 && empty($this->currentId) && (JRequest::getVar('option','')!='com_hikashop'|| !in_array(JRequest::getVar('ctrl','product'),array('product','category')) ||JRequest::getVar('task','listing')!='listing')))){
		$type = 'category';
		if(!HIKASHOP_J30){
			$menuClass = hikashop_get('class.menus');
			$menuData = $menuClass->get($this->params->get('itemid',0));
			if(@$menuData->hikashop_params['content_type']=='product')
				$type = 'product';
		}else{
			$app = JFactory::getApplication();
			$oldActiveMenu = $app->getMenu()->getActive();
			$app->getMenu()->setActive($this->params->get('itemid',0));
			$menuItem = $app->getMenu()->getActive();
			if (isset($oldActiveMenu) )
				$app->getMenu()->setActive($oldActiveMenu->id);
			$hkParams = false;
			if(isset($menuItem->params))
				$hkParams = $menuItem->params->get('hk_category',false);
			if(!$hkParams)
				$type = 'product';
		}
		$url = hikashop_completeLink($type.'&task=listing&Itemid='.$this->params->get('itemid',0));
	}else{
		$url = preg_replace('#&return_url=[^&]+#i','',$url);
	}
to:
$url = '';
	if(!empty($this->params) && $this->params->get('module') == 'mod_hikashop_filter' && ($this->params->get('force_redirect',0) || (JRequest::getVar('force_using_filters', 0) !== 1 && empty($this->currentId) && (JRequest::getVar('option','')!='com_hikashop'|| !in_array(JRequest::getVar('ctrl','product'),array('product','category')) ||JRequest::getVar('task','listing')!='listing')))){
		$type = 'category';
		if(!HIKASHOP_J30){
			$menuClass = hikashop_get('class.menus');
			$menuData = $menuClass->get($this->params->get('itemid',0));
			if(@$menuData->hikashop_params['content_type']=='product')
				$type = 'product';
		}else{
			$app = JFactory::getApplication();
			$oldActiveMenu = $app->getMenu()->getActive();
			$app->getMenu()->setActive($this->params->get('itemid',0));
			$menuItem = $app->getMenu()->getActive();
			if (isset($oldActiveMenu) )
				$app->getMenu()->setActive($oldActiveMenu->id);
			$hkParams = false;
			if(isset($menuItem->params)) {
				$hkParams = $menuItem->params->get('hk_category',false);
				if($hkParams){
					$url = hikashop_completeLink('Itemid='.$this->params->get('itemid',0));
				}else{
					$type = 'product';
					$hkParams = $menuItem->params->get('hk_product',false);
					if($hkParams){
						$url = hikashop_completeLink('Itemid='.$this->params->get('itemid',0));
					}
				}
			}
		}
		if(empty($url))
			$url = hikashop_completeLink($type.'&task=listing&Itemid='.$this->params->get('itemid',0));
	}else{
		$url = preg_replace('#&return_url=[^&]+#i','',hikashop_currentURL());
	}
in the file "filter" of the view "product" via the menu Display>Views (the code change is based on the latest version of HikaShop) and that should remove the product/listing part when not necessary but doing something else is not possible.

2. That's only because you've displayed the filter in the HikaShop filter module and you've activated the "force redirect" setting of the module.
If you turn off that option, it will only redirect to the menu item of the module if you're not on a HikaShop listing.

3. There are no category filters.

Last edit: 6 years 9 months ago by nicolas.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum