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

#   Merge the product\_code filtering with product\_name

##

- **[Shulha](/forum/user/10532-shulha "View Shulha's Profile")**
- [![Shulha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10532-shulha "View Shulha's Profile") Topic Author
- [ Offline](/forum/user/10532-shulha)

Less More

- Posts: 98
- Thank you received: 2
-
-

13 years 3 months ago -  13 years 3 months ago [\#118775](#118775) by [Shulha](/forum/user/10532-shulha "View Shulha's Profile")  *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118775 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")* was created by *[Shulha](/forum/user/10532-shulha "View Shulha's Profile")*

Hi there! I wander if there's any way to merge (unite) the filtering by product_code and by product_name. In other words, so as I could have only one text-type filter, where you can make correct filtering both on product_code and product_name.
Is this hard to implement? Maybe you can tell me how to edit the file Code:

administrator/components/com_hikashop/classes/filter.php

?

Any help is appreciated.

Last edit: 13 years 3 months ago by [Shulha](/forum/user/10532-shulha "View Shulha's Profile").

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 3 months ago [\#118794](#118794) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118794 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Hi,

Via the menu Display &gt; Filters, you can create a new one filter with the type "text" and for the "apply on" option you can select many values, in your case "product_name" and "product_code".

No code is needed ![;)](/media/kunena/emoticons/24.png ";)") If you can't select many values, thanks to update your HikaShop version.

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

- **[Shulha](/forum/user/10532-shulha "View Shulha's Profile")**
- [![Shulha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10532-shulha "View Shulha's Profile") Topic Author
- [ Offline](/forum/user/10532-shulha)

Less More

- Posts: 98
- Thank you received: 2
-
-

13 years 3 months ago [\#118906](#118906) by [Shulha](/forum/user/10532-shulha "View Shulha's Profile")  Replied by *[Shulha](/forum/user/10532-shulha "View Shulha's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118906 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

> Xavier wrote: Hi,
>
> Via the menu Display &gt; Filters, you can create a new one filter with the type "text" and for the "apply on" option you can select many values, in your case "product\_name" and "product\_code".
>
> No code is needed ![;)](/media/kunena/emoticons/24.png ";)") If you can't select many values, thanks to update your HikaShop version.

Thank you! I didn't know I could select multiply types:)
But I got a next question. Is there a way to make something like this? [ 365psd.com/wp-content/uploads/2011/05/search-field.jpg](http://365psd.com/wp-content/uploads/2011/05/search-field.jpg) so as I could comment what is this field intended for?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

13 years 3 months ago [\#118945](#118945) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118945 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Hi,

Yes, with some CSS and some override you can customize the display of the filter.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[Shulha](/forum/user/10532-shulha "View Shulha's Profile")**
- [![Shulha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10532-shulha "View Shulha's Profile") Topic Author
- [ Offline](/forum/user/10532-shulha)

Less More

- Posts: 98
- Thank you received: 2
-
-

13 years 3 months ago [\#118959](#118959) by [Shulha](/forum/user/10532-shulha "View Shulha's Profile")  Replied by *[Shulha](/forum/user/10532-shulha "View Shulha's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118959 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

> Jerome wrote: Hi,
>
> Yes, with some CSS and some override you can customize the display of the filter.
>
> Regards,

Thank you! Will dig it up!

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

- **[Shulha](/forum/user/10532-shulha "View Shulha's Profile")**
- [![Shulha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/10532-shulha "View Shulha's Profile") Topic Author
- [ Offline](/forum/user/10532-shulha)

Less More

- Posts: 98
- Thank you received: 2
-
-

13 years 3 months ago -  13 years 3 months ago [\#118971](#118971) by [Shulha](/forum/user/10532-shulha "View Shulha's Profile")  Replied by *[Shulha](/forum/user/10532-shulha "View Shulha's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#118971 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

> Jerome wrote: Hi,
>
> Yes, with some CSS and some override you can customize the display of the filter.
>
> Regards,

Hi there! I decided to do it via "&lt;input type search placeholder="Some Text"&gt;

I edited line 1133 of the administrator/components/com_hikashop/classes/filter.php

And made this edition:
Code:

$html = '&lt;input '.$style.' name="filter_'.$filter-&gt;filter_namekey.'" '.$onBlur.' type=search placeholder="Some text" '.$filter-&gt;filter_name.'" value="'.$name.'"&gt;';

Everything seems to work. But due to the fact I am COMPLETELY new to the php (don't even realize how did I get this work) could you please check how valid my edition is? Big thank you in advance.

Last edit: 13 years 3 months ago by [Shulha](/forum/user/10532-shulha "View Shulha's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

13 years 3 months ago [\#119022](#119022) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#119022 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Hi,

Well, your modification should work, I recommend you to add quotes around "search". Code:

$html = '&lt;input '.$style.' name="filter_'.$filter-&gt;filter_namekey.'" '.$onBlur.' type="search" placeholder="Some text" '.$filter-&gt;filter_name.'" value="'.$name.'"&gt;';

After that, in order to have something more "clean", using options should be better. Code:

$style=''; if($filter-&gt;filter_options['textBoxSize']){ $style='style="width: 90%;"'; } if(!empty($filter-&gt;filter_options['textBoxType'])){ $style .= ' type="'.$filter-&gt;filter_options['textBoxType'].'"'; } if(!empty($filter-&gt;filter_options['textBoxPlaceholder'])){ $style .= ' placeholder="'.str_replace('"','&amp;quot;',$filter-&gt;filter_options['textBoxPlaceholder']).'"'; }

But it will require some other modifications in order to add these options.
Modification of the filter type (javascript generated), modification of the view "filter &#124; form_option" in the backend, in order to add the new options.

But your current code looks good.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile")
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 643
- Thank you received: 26
-
-
-

8 years 11 months ago [\#284764](#284764) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  Replied by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#284764 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Hi Jerome,

Is there a more simple way 4 years later? Can I add something to the filter view?

Or can you please make a small improvement to the filter under Display&gt;Filters (type text) to add an extra placeholder field?
So we could use that, because I think a lot of people would like to have a placeholder for the type text.

Hope to hear from you.

Kind regards,
Lumiga

---

Kind regards,
Lumiga

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg2MTA4Ni1tZXJnZS10aGUtcHJvZHVjdC1jb2RlLWZpbHRlcmluZy13aXRoLXByb2R1Y3QtbmFtZT90bXBsPW1hcmtkb3du) 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
-
-

8 years 11 months ago [\#284767](#284767) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#284767 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Hi,

There is no option for that for now so you would have to edit the filter view.
However, that's a good idea. We'll look at adding an option for that in the next version of HikaShop which is to be released soon.

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

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile")
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 643
- Thank you received: 26
-
-
-

8 years 11 months ago [\#284780](#284780) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  Replied by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#284780 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Oké perfect in that case I'll wait for the new release. ![;-)](/media/kunena/emoticons/24.png ";-)")

---

Kind regards,
Lumiga

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

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile")
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 643
- Thank you received: 26
-
-
-

8 years 10 months ago [\#284931](#284931) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  Replied by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")* on topic *[Merge the product\_code filtering with product\_name](/forum/45-filters-search/861086-merge-the-product-code-filtering-with-product-name#284931 "Hi there! I wander if there's any way to merge (unite) the filtering by product&#95;code and by product&#95;name. In other words, so as I could have only one text-type filter, where you can make correct...")*

Thanks Nicolas and the rest of the team!

This works great for me. ![;-)](/media/kunena/emoticons/24.png ";-)")

[ ![screenshot-66.png](/forum/attachment/41925) ](/forum/attachment/41925 "screenshot-66.png")

---

Kind regards,
Lumiga

- [ ![screenshot-66.png](/forum/attachment/41925) ](/forum/attachment/41925 "screenshot-66.png") [ ](/forum/attachment/41925?download=1 "screenshot-66.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzg2MTA4Ni1tZXJnZS10aGUtcHJvZHVjdC1jb2RlLWZpbHRlcmluZy13aXRoLXByb2R1Y3QtbmFtZT90bXBsPW1hcmtkb3du) 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.118 seconds

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