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

#   State field mandatory when set to not required

##

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

Less More

- Posts: 50
- Thank you received: 4
-

5 years 1 week ago [\#337195](#337195) by [infinityb](/forum/user/60598-infinityb "View infinityb's Profile")  *[State field mandatory when set to not required](/forum/27-checkout/903508-state-field-mandatory-when-set-to-not-required#337195 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 3.10.3  Since version 4.4.3, I think, the state field has been mandatory on the checkout even when it is not set to required.")* was created by *[infinityb](/forum/user/60598-infinityb "View infinityb's Profile")*

-- HikaShop version -- : 4.4.4
-- Joomla version -- : 3.10.3

Since version 4.4.3, I think, the state field has been mandatory on the checkout even when it is not set to required.

- [ ![Screenshot&#95;2021-11-17THJoomlaTestWebsite-Administration-Fieldaddress&#95;state&#95;2021-11-17.png](/forum/attachment/53892) ](/forum/attachment/53892 "...2021-11-17.png") [ ](/forum/attachment/53892?download=1 "...2021-11-17.png")
- [ ![Screenshot&#95;2021-11-17Checkout&#95;2021-11-17.png](/forum/attachment/53893) ](/forum/attachment/53893 "...2021-11-17.png") [ ](/forum/attachment/53893?download=1 "...2021-11-17.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMzUwOC1zdGF0ZS1maWVsZC1tYW5kYXRvcnktd2hlbi1zZXQtdG8tbm90LXJlcXVpcmVkP3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14327
-
-

5 years 1 week ago [\#337228](#337228) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[State field mandatory when set to not required](/forum/27-checkout/903508-state-field-mandatory-when-set-to-not-required#337228 "-- HikaShop version -- : 4.4.4 -- Joomla version -- : 3.10.3  Since version 4.4.3, I think, the state field has been mandatory on the checkout even when it is not set to required.")*

Hi,

Thanks for the report.
I was able to reproduce the issue on my end.
It's because the "please select" choice is not properly taken into account.
Add the code: Code:

if(!empty($field-&gt;field_options['pleaseselect'])) { $states[''] = ''; }

after the line: Code:

$states = $countryType-&gt;load();

in the file administrator/components/com_hikashop/classes/field.php and it will fix the problem.
We'll add the fix on our end for the next version.

The following user(s) said Thank You: [infinityb](/forum/user/60598-infinityb "View infinityb's Profile")

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

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