[Skip to main content](#vessel-content)

#   A few questions with filters and search

##

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

9 years 5 months ago -  9 years 5 months ago [\#272199](#272199) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  *[A few questions with filters and search](/forum/45-filters-search/890773-a-few-questions-with-filters-and-search#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.")* was created by *[ronron](/forum/user/40399-ronron "View ronron's Profile")*

-- 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: 9 years 5 months ago by [ronron](/forum/user/40399-ronron "View ronron's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MDc3My1hLWZldy1xdWVzdGlvbnMtd2l0aC1maWx0ZXJzLWFuZC1zZWFyY2g/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

9 years 5 months ago -  9 years 5 months ago [\#272207](#272207) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[A few questions of filters and search](/forum/45-filters-search/890773-a-few-questions-with-filters-and-search#272207 "-- 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.")*

Hi,

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

$url = hikashop_currentURL(); if(!empty($this-&gt;params) &amp;&amp; $this-&gt;params-&gt;get('module') == 'mod_hikashop_filter' &amp;&amp; ($this-&gt;params-&gt;get('force_redirect',0) &#124;&#124; (JRequest::getVar('force_using_filters', 0) !== 1 &amp;&amp; empty($this-&gt;currentId) &amp;&amp; (JRequest::getVar('option','')!='com_hikashop'&#124;&#124; !in_array(JRequest::getVar('ctrl','product'),array('product','category')) &#124;&#124;JRequest::getVar('task','listing')!='listing')))){ $type = 'category'; if(!HIKASHOP_J30){ $menuClass = hikashop_get('class.menus'); $menuData = $menuClass-&gt;get($this-&gt;params-&gt;get('itemid',0)); if(@$menuData-&gt;hikashop_params['content_type']=='product') $type = 'product'; }else{ $app = JFactory::getApplication(); $oldActiveMenu = $app-&gt;getMenu()-&gt;getActive(); $app-&gt;getMenu()-&gt;setActive($this-&gt;params-&gt;get('itemid',0)); $menuItem = $app-&gt;getMenu()-&gt;getActive(); if (isset($oldActiveMenu) ) $app-&gt;getMenu()-&gt;setActive($oldActiveMenu-&gt;id); $hkParams = false; if(isset($menuItem-&gt;params)) $hkParams = $menuItem-&gt;params-&gt;get('hk_category',false); if(!$hkParams) $type = 'product'; } $url = hikashop_completeLink($type.'&amp;task=listing&amp;Itemid='.$this-&gt;params-&gt;get('itemid',0)); }else{ $url = preg_replace('#&amp;return_url=[^&amp;]+#i','',$url); }

to: Code:

$url = ''; if(!empty($this-&gt;params) &amp;&amp; $this-&gt;params-&gt;get('module') == 'mod_hikashop_filter' &amp;&amp; ($this-&gt;params-&gt;get('force_redirect',0) &#124;&#124; (JRequest::getVar('force_using_filters', 0) !== 1 &amp;&amp; empty($this-&gt;currentId) &amp;&amp; (JRequest::getVar('option','')!='com_hikashop'&#124;&#124; !in_array(JRequest::getVar('ctrl','product'),array('product','category')) &#124;&#124;JRequest::getVar('task','listing')!='listing')))){ $type = 'category'; if(!HIKASHOP_J30){ $menuClass = hikashop_get('class.menus'); $menuData = $menuClass-&gt;get($this-&gt;params-&gt;get('itemid',0)); if(@$menuData-&gt;hikashop_params['content_type']=='product') $type = 'product'; }else{ $app = JFactory::getApplication(); $oldActiveMenu = $app-&gt;getMenu()-&gt;getActive(); $app-&gt;getMenu()-&gt;setActive($this-&gt;params-&gt;get('itemid',0)); $menuItem = $app-&gt;getMenu()-&gt;getActive(); if (isset($oldActiveMenu) ) $app-&gt;getMenu()-&gt;setActive($oldActiveMenu-&gt;id); $hkParams = false; if(isset($menuItem-&gt;params)) { $hkParams = $menuItem-&gt;params-&gt;get('hk_category',false); if($hkParams){ $url = hikashop_completeLink('Itemid='.$this-&gt;params-&gt;get('itemid',0)); }else{ $type = 'product'; $hkParams = $menuItem-&gt;params-&gt;get('hk_product',false); if($hkParams){ $url = hikashop_completeLink('Itemid='.$this-&gt;params-&gt;get('itemid',0)); } } } } if(empty($url)) $url = hikashop_completeLink($type.'&amp;task=listing&amp;Itemid='.$this-&gt;params-&gt;get('itemid',0)); }else{ $url = preg_replace('#&amp;return_url=[^&amp;]+#i','',hikashop_currentURL()); }

in the file "filter" of the view "product" via the menu Display&gt;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: 9 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg5MDc3My1hLWZldy1xdWVzdGlvbnMtd2l0aC1maWx0ZXJzLWFuZC1zZWFyY2g/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
