cancel
Showing results for 
Search instead for 
Did you mean: 

SUPEE-9767 V2 - Formkey contains disabled on step 5 checkout for Payment

SUPEE-9767 V2 - Formkey contains disabled on step 5 checkout for Payment

Hi,

     I have recently applied Supee-9767 to my Magento 1.7.0.2 platform.  We use a custom template so I added the formkey code to each required element.

 

<?php echo $this->getBlockHtml('formkey') ?>

 

All works great and as it should except for the payment.phtml side of the checkout.  You select your pyament method, hit continue and nothing happens.  I have disabled all methods one at a time and still the same, so it's not the methods.....

 

I have debugged and found that the form key within my payment.phtml looks like this:

 

<input name="form_key" type="hidden" value="d6tcsZHkrrfgqdD9" disabled>

 

Note the disabled on the end.  Now within my debugger, if I remove disabled - checkout works..... but for the life of me I cannot work out why this formkey is disabling.

 

Can anybody help/shed any light on what's going on here?

 

Cheers

 

Damian

3 REPLIES 3

Re: SUPEE-9767 V2 - Formkey contains disabled on step 5 checkout for Payment

Having the same exact problem. Any luck?

Re: SUPEE-9767 V2 - Formkey contains disabled on step 5 checkout for Payment

Hi @damianb123,

 

I was checking both versions (1.7.0.2 and 1.9.3.4) and the disbaled tag isn't present.

 

1.7.0.2

https://github.com/OpenMage/magento-mirror/blob/1.7.0.2/app/design/frontend/base/default/template/co...

 

1.9.3.4

https://github.com/OpenMage/magento-mirror/blob/1.9.3.4/app/design/frontend/base/default/template/co...

 

Is it possile that some JS plugin is disabling input fields?

Can you try with the default theme of Magento and/or disabling 3rd-party modules?

Re: SUPEE-9767 V2 - Formkey contains disabled on step 5 checkout for Payment

Hi guys! The answer is very simple. Please, open opcheckout.js and change next line:

if (elements[i].name=='payment[method]') {

to

if (elements[i].name=='payment[method]' || elements[i].name == 'form_key') {

 

Please, read the next code lines and you will understand all:

if (elements[i].name=='payment[method]' || elements[i].name == 'form_key') {
                if (elements[i].checked) {
                    method = elements[i].value;
                }
            } else {
                elements[i].disabled = true;
            }
            elements[i].setAttribute('autocomplete','off');