Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 1.7: "Place Order" disabled by default in PayPal Express Review

Tags:

magento

paypal

Since Magento 1.7.0.1, the "Place Order" button on the review page of PayPal Express is disabled by default. When the user ticks both checkboxes, it stays disabled. The user needs to tick the checkboxes and click on "Update Order Data". After the site is reloaded, "Place Order"/"Kaufen" is enabled.

How can this bug be fixed? It is also present in 1.7.0.2.

Disabled Process Order button

like image 348
SebiF Avatar asked Jul 30 '12 11:07

SebiF


1 Answers

For me this is more like a bug or unexpected behavior, because the agreements checkbox is not related with the customer address and it doesn't have any business with PayPal express :)

I found a workaround, that works for me, but I can't say that it's is a example of the best development practices.

Short explanation of the problem: The problem comes from the fact, that on the PayPal Express review page we have JavaScript functions, that activate an event handler on change of all form elements. This event handler disable the "place order" button. This should work in that way if we change for element, that is related with the customer address ... Well of course the agreement checkboxes are not related with the customer address and seems, that the folks from Magento missed, that moment :)

Here is the solution:

  1. find file "template/paypal/review.phtml" ... if you don't have this file in your theme, just copy it from the base theme
  2. Add add the lines of code after //Workaround to unbind the event listeners for the agreement checkboxes at the bottom of the file. Take the code from here: https://gist.github.com/4503260

Basically this recreates agreement checkboxes and as side effect the new checkboxes, don't have event listeners, that disable the place order button.

Hope, that it helps :)

like image 97
ceckoslab Avatar answered Nov 04 '22 00:11

ceckoslab