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

#   Required checkout custom field only on step 4

##

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

Less More

- Posts: 42
- Thank you received: 1
-
-

11 years 3 weeks ago [\#218223](#218223) by [Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")  *[Required checkout custom field only on step 4](/forum/27-checkout/880029-required-checkout-custom-field-only-on-step-4#218223 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.6.13 -- Browser(s) name and version -- : Firefox 40.0.3  Hi,  I have some checkout custom field and I want to show it only on step 4, it is a required field. In my components/com&#95;hikashop/views/checkout/tmpl/custom&#95;fields.php override I have:  When I'm on step 2 and I'm trying to go to step 3, I'm getting alert which says that my &quot;my&#95;special&#95;field4&quot; is required and I must fill it. Of course &quot;my&#95;special&#95;field4&quot; is not visible on step 2, I can see in page source there's display:none and type=&quot;hidden&quot; applied, but still javascript is looking for this field if it's filled or not (on step 2 I have also other checkout fields). How can I fix this?  Best regards, Chris")* was created by *[Gnsbud](/forum/user/37991-gnsbud "View Gnsbud's Profile")*

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.6.13
-- Browser(s) name and version -- : Firefox 40.0.3

Hi,

I have some checkout custom field and I want to show it only on step 4, it is a required field.
In my components/com_hikashop/views/checkout/tmpl/custom_fields.php override I have: Code:

$showfields = array( 'my_special_field4' =&gt; 4, // my_special_field4 display only on step 4 );

When I'm on step 2 and I'm trying to go to step 3, I'm getting alert which says that my "my_special_field4" is required and I must fill it. Of course "my_special_field4" is not visible on step 2, I can see in page source there's display:none and type="hidden" applied, but still javascript is looking for this field if it's filled or not (on step 2 I have also other checkout fields). How can I fix this?

Best regards,
Chris

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4MDAyOS1yZXF1aXJlZC1jaGVja291dC1jdXN0b20tZmllbGQtb25seS1vbi1zdGVwLTQ/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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 3 weeks ago [\#218228](#218228) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Required checkout custom field only on step 4](/forum/27-checkout/880029-required-checkout-custom-field-only-on-step-4#218228 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.6.13 -- Browser(s) name and version -- : Firefox 40.0.3  Hi,  I have some checkout custom field and I want to show it only on step 4, it is a required field. In my components/com&#95;hikashop/views/checkout/tmpl/custom&#95;fields.php override I have:  When I'm on step 2 and I'm trying to go to step 3, I'm getting alert which says that my &quot;my&#95;special&#95;field4&quot; is required and I must fill it. Of course &quot;my&#95;special&#95;field4&quot; is not visible on step 2, I can see in page source there's display:none and type=&quot;hidden&quot; applied, but still javascript is looking for this field if it's filled or not (on step 2 I have also other checkout fields). How can I fix this?  Best regards, Chris")*

Hi,

Splitting custom fields on several steps will only work if the fields are not required.
If you need to have them required, then it will require complex changes in the file administrator/components/com_hikashop/classes/field.php which handle the output of the js code to check the fields and also handle the server side check after the form is submitted. Both will have to be changed.

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

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