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

#   Do not want default value to show in filter

##

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

Less More

- Posts: 165
- Thank you received: 3
-
-

12 years 11 months ago -  12 years 11 months ago [\#137402](#137402) by [jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile")  *[Do not want default value to show in filter](/forum/45-filters-search/864486-do-not-want-default-value-to-show-in-filter#137402 "-- url of the page with the problem -- :   67.43.0.213/  -- HikaShop version -- :2.2.3 -- Joomla version -- : 3.2.1 -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I have a problem. I have a filter on my site right now called &quot;test&quot; under the section of the top of my page called &quot;Quick Search&quot;. It is a filter based off of my custom fields. The problem I am having is in the backend of the site I have a selection of mattress types called, gel, firm, pillowtop, etc.  The problem I am having is i have to have this field required in the backend of the site, so I made a default title called N/A and left the value blank so it would require this field. However on the frontend of the website it shows this value. I do not want N/A shown on the frontend of the website. I want the default selection to be set to &quot;all&quot; by default.  How can I accomplish this? I have tried for hours to figure this out and cannot.  Thanks,  Josh")* was created by *[jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile")*

-- url of the page with the problem -- : [ 67.43.0.213/](http://67.43.0.213/)
-- HikaShop version -- :2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi, I have a problem. I have a filter on my site right now called "test" under the section of the top of my page called "Quick Search". It is a filter based off of my custom fields. The problem I am having is in the backend of the site I have a selection of mattress types called, gel, firm, pillowtop, etc.

The problem I am having is i have to have this field required in the backend of the site, so I made a default title called N/A and left the value blank so it would require this field. However on the frontend of the website it shows this value. I do not want N/A shown on the frontend of the website. I want the default selection to be set to "all" by default.

How can I accomplish this? I have tried for hours to figure this out and cannot.

Thanks,

Josh

Last edit: 12 years 11 months ago by [jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile").

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 10 months ago [\#137547](#137547) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Do not want default value to show in filter](/forum/45-filters-search/864486-do-not-want-default-value-to-show-in-filter#137547 "-- url of the page with the problem -- :   67.43.0.213/  -- HikaShop version -- :2.2.3 -- Joomla version -- : 3.2.1 -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I have a problem. I have a filter on my site right now called &quot;test&quot; under the section of the top of my page called &quot;Quick Search&quot;. It is a filter based off of my custom fields. The problem I am having is in the backend of the site I have a selection of mattress types called, gel, firm, pillowtop, etc.  The problem I am having is i have to have this field required in the backend of the site, so I made a default title called N/A and left the value blank so it would require this field. However on the frontend of the website it shows this value. I do not want N/A shown on the frontend of the website. I want the default selection to be set to &quot;all&quot; by default.  How can I accomplish this? I have tried for hours to figure this out and cannot.  Thanks,  Josh")*

Hi Josh,
The solution will probably be to :
- Set the "Default value" option of your custom field to "All"
- Go to the page "Hikasohp-&gt;Display-&gt;Custom Fields" and set the "required" option of your custom field to **YES**.

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

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

Less More

- Posts: 165
- Thank you received: 3
-
-

12 years 10 months ago -  12 years 10 months ago [\#137597](#137597) by [jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile")  Replied by *[jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile")* on topic *[Do not want default value to show in filter](/forum/45-filters-search/864486-do-not-want-default-value-to-show-in-filter#137597 "-- url of the page with the problem -- :   67.43.0.213/  -- HikaShop version -- :2.2.3 -- Joomla version -- : 3.2.1 -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I have a problem. I have a filter on my site right now called &quot;test&quot; under the section of the top of my page called &quot;Quick Search&quot;. It is a filter based off of my custom fields. The problem I am having is in the backend of the site I have a selection of mattress types called, gel, firm, pillowtop, etc.  The problem I am having is i have to have this field required in the backend of the site, so I made a default title called N/A and left the value blank so it would require this field. However on the frontend of the website it shows this value. I do not want N/A shown on the frontend of the website. I want the default selection to be set to &quot;all&quot; by default.  How can I accomplish this? I have tried for hours to figure this out and cannot.  Thanks,  Josh")*

Hi thanks for the answer, but this will not work for what I am trying to do. I attached a screenshot of the custom fields for you to see.

On the backend I already have the field set to required. Yes, it makes the field required, but If I do not add the option N/A on the backend it autoselects the default value. In my case if I do not have N/A as the default option with a blank value it will autoselect one of my my filter values as a default value which cannot happen. The default value needs to be blank until my client selects an option, that way when you click save in the backend it says field required and will not let you save the product until you fill this out.

If you do what you are saying it saves the product with whatever the default value is which cannot happen.

I understand if you remove the N/A with the blank default value that it will auto select "All" in the front end, but this will just not work with what I am trying to do. Also, I cannot just name the value to "all" either this will not work because all needs to actually be all products and if you do that the word all would show up twice in the dropdown.

How can I get this to happen?

Thanks,

Josh

- [ ![h9b7273e.JPG](/forum/attachment/14414) ](/forum/attachment/14414 "h9b7273e.JPG") [ ](/forum/attachment/14414?download=1 "h9b7273e.JPG")

Last edit: 12 years 10 months ago by [jschroeder](/forum/user/13561-jschroeder "View jschroeder's Profile").

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

12 years 10 months ago [\#137771](#137771) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Do not want default value to show in filter](/forum/45-filters-search/864486-do-not-want-default-value-to-show-in-filter#137771 "-- url of the page with the problem -- :   67.43.0.213/  -- HikaShop version -- :2.2.3 -- Joomla version -- : 3.2.1 -- PHP version -- : x.x.x -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hi, I have a problem. I have a filter on my site right now called &quot;test&quot; under the section of the top of my page called &quot;Quick Search&quot;. It is a filter based off of my custom fields. The problem I am having is in the backend of the site I have a selection of mattress types called, gel, firm, pillowtop, etc.  The problem I am having is i have to have this field required in the backend of the site, so I made a default title called N/A and left the value blank so it would require this field. However on the frontend of the website it shows this value. I do not want N/A shown on the frontend of the website. I want the default selection to be set to &quot;all&quot; by default.  How can I accomplish this? I have tried for hours to figure this out and cannot.  Thanks,  Josh")*

Hi,

I think that you can do that by adding the code: Code:

if(empty($val[0]) &amp;&amp; $field-&gt;field_required) continue;

before the code: Code:

$html.='&lt;OPTION '.$selectedItem.' name="'.$filter-&gt;filter_data.'" value="'.$val[0].'"&gt;'.JText::_($val[1]).'&lt;/OPTION&gt;';

in the file administrator/components/com_hikashop/classes/filter.php

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

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