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

#   Redundant Call to CheckChangeForm

##

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 7 months ago [\#199257](#199257) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  *[Redundant Call to CheckChangeForm](/forum/27-checkout/876491-redundant-call-to-checkchangeform#199257 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.6.3 -- PHP version -- : 5.5.17  Hello, there.  Good morning!  Please could you explain the purpose of the following code in checkout/step.php?  In media/com&#95;hikashop/js/hikashop.js, the hikashopCheckChangeForm does not have any test for the value of 'order' in the type parameter. Does this mean that the call to hikashopCheckChangeForm from checkout/step.php is redundant?  Thanks.  Take care!")* was created by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.6.3
-- PHP version -- : 5.5.17

Hello, there.

Good morning!

Please could you explain the purpose of the following code in checkout/step.php?
Code:

echo $this-&gt;cart-&gt;displayButton($checkout_next_button,'next',$this-&gt;params, hikashop_completeLink('checkout&amp;task=step&amp;step='.$this-&gt;step+1),'if(hikashopCheckChangeForm(\'order\',\'hikashop_checkout_form\')){ if(hikashopCheckMethods()){ document.getElementById(\'hikashop_validate\').value=1; this.disabled = true; document.forms[\'hikashop_checkout_form\'].submit();}} return false;','id="hikashop_checkout_next_button"');

In media/com_hikashop/js/hikashop.js, the hikashopCheckChangeForm does not have any test for the value of 'order' in the type parameter. Does this mean that the call to hikashopCheckChangeForm from checkout/step.php is redundant?

Thanks.

Take care!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NjQ5MS1yZWR1bmRhbnQtY2FsbC10by1jaGVja2NoYW5nZWZvcm0/dG1wbD1tYXJrZG93bg==) 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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 7 months ago [\#199315](#199315) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Redundant Call to CheckChangeForm](/forum/27-checkout/876491-redundant-call-to-checkchangeform#199315 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.6.3 -- PHP version -- : 5.5.17  Hello, there.  Good morning!  Please could you explain the purpose of the following code in checkout/step.php?  In media/com&#95;hikashop/js/hikashop.js, the hikashopCheckChangeForm does not have any test for the value of 'order' in the type parameter. Does this mean that the call to hikashopCheckChangeForm from checkout/step.php is redundant?  Thanks.  Take care!")*

Hi,

The code will check the checkout form (to check the order) and submit it if good.
I don't understand why you think that the code is redundant.

Regards,

---

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

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

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 6 months ago [\#200628](#200628) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  Replied by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")* on topic *[Redundant Call to CheckChangeForm](/forum/27-checkout/876491-redundant-call-to-checkchangeform#200628 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.6.3 -- PHP version -- : 5.5.17  Hello, there.  Good morning!  Please could you explain the purpose of the following code in checkout/step.php?  In media/com&#95;hikashop/js/hikashop.js, the hikashopCheckChangeForm does not have any test for the value of 'order' in the type parameter. Does this mean that the call to hikashopCheckChangeForm from checkout/step.php is redundant?  Thanks.  Take care!")*

Thanks, Jerome.

As stated, there is no test for the value of "order" in the hikashopCheckChangeForm function in the file media/com_hikashop/js/hikashop.js. How does the hikashopCheckChangeForm function check if the order is valid?

Thanks.

Take care!

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

11 years 6 months ago [\#200638](#200638) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Redundant Call to CheckChangeForm](/forum/27-checkout/876491-redundant-call-to-checkchangeform#200638 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.6.3 -- PHP version -- : 5.5.17  Hello, there.  Good morning!  Please could you explain the purpose of the following code in checkout/step.php?  In media/com&#95;hikashop/js/hikashop.js, the hikashopCheckChangeForm does not have any test for the value of 'order' in the type parameter. Does this mean that the call to hikashopCheckChangeForm from checkout/step.php is redundant?  Thanks.  Take care!")*

Hi,

There are tests for the value "order" in hikashopCheckChangeForm so I don't see what you're talking about.
This is the code of that function which test the custom fields on the checkout: Code:

for(var i = hikashopFieldsJs['reqFieldsComp'][type].length - 1; i &gt;= 0; i--) { elementName = 'data['+type+']['+hikashopFieldsJs['reqFieldsComp'][type][i]+']'; if(typeof(varform.elements[elementName]) == 'undefined') elementName = type+'_'+hikashopFieldsJs['reqFieldsComp'][type][i]; elementToCheck = varform.elements[elementName]; elementId = 'hikashop_'+type+'_'+ hikashopFieldsJs['reqFieldsComp'][type][i]; el = d.getElementById(elementId); if(elementToCheck &amp;&amp; (typeof el == 'undefined' &#124;&#124; el == null &#124;&#124; typeof el.style == 'undefined' &#124;&#124; el.style.display!='none') &amp;&amp; !hikashopCheckField(elementToCheck,type,i,elementName,varform.elements)) { if(typeof(hikashopFieldsJs['entry_id']) == 'undefined') return false; for(var j = 1; j &lt;= hikashop['entry_id']; j++) { elementName = 'data['+type+'][entry_'+j+']['+hikashopFieldsJs['reqFieldsComp'][type][i]+']'; elementToCheck = varform.elements[elementName]; elementId = 'hikashop_'+type+'_'+ hikashopFieldsJs['reqFieldsComp'][type][i] + '_' + j; el = d.getElementById(elementId); if(elementToCheck &amp;&amp; (typeof el == 'undefined' &#124;&#124; el == null &#124;&#124; typeof el.style == 'undefined' &#124;&#124; el.style.display != 'none') &amp;&amp; !hikashopCheckField(elementToCheck,type,i,elementName,varform.elements)) { return false; } } } }

It does the check for the custom user fields, the custom address fields and the custom order fields based on what is given to that function in the first parameter. If you remove that call, it won't check the custom order fields on the checkout and thus you'll be able to finish a step with the "fields" view on the checkout even if you have required custom order fields that are not filled. So it's not redundant, it's the way it should be.

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

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