0

When going through the one step checkout process, Paypal Express is encountering an error where the page is not being properly redirected.

By debugging into opcheckout.js, in the function setStepResponse, this line was stopping execution of all JS:

$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);

Some additional debugging showed that response.update_section.name was undefined.

By adding a custom observer to the hook controller_action_postdispatch_checkout and ensuring a name is set, I was able to fix this problem.

The Enterprise extension GoogleAnalyticsUniversal has an observer tied to the same event that calls the function setGoogleAnalyticsOnCheckout. It appears that this function is causing the problem.

Is this a bug in Enterprise? Or is it possible the data is "corrupted" upstream by a custom extension?

3
  • I'm not sure if I'm allowed to post the code of the setGoogleAnalyticsOnCheckout function since the code is part of Enterprise.
    – Ryre
    Feb 23, 2017 at 20:47
  • Ryre - We just ran into this as well. I've placed a support ticket with Magento and will report back on anything we find. This site is on 1.14.2.2, what version are you seeing this issue in? And did you find a fix?
    – GregC
    Mar 31, 2017 at 15:51
  • Thanks for reminding me to follow up! I just posted the answer I received from support.
    – Ryre
    Mar 31, 2017 at 16:52

1 Answer 1

1

After contacting Magento's Enterprise support, it was confirmed this is a bug between GTM and Paypal Express.

I was able to fix this problem by creating an observer on setGoogleAnalyticsOnCheckout in Enterprise_GoogleAnalyticsUniversal_Model_Observer. The saveBilling function has this line:

$body['update_section']['name'] = 'shipping';

My observer uses the same logic as this line to add a name to savePayment which fixes the broken javascript and allows the checkout process to continue.

I did receive a patch from Magento that resolves the problem in a similar fashion (it modifies core code instead of creating an observer), but I'm unsure if I'm allowed to share it. The name of the patch is "PATCH_SUPEE-6717_EE_1.14.2.0_v1.sh".

1
  • 1
    Haha - We just got the same answer. Thanks!
    – GregC
    Mar 31, 2017 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.