Closed HenKun closed 1 year ago
I made a patch for version 5.14.1 in case anyone else encounters the issue amzn-button-login-render-gh-issue-1141.txt
Hello @HenKun ,
Thanks for sharing that find, and posting a fix as well! Theoretically this issue could happen on any page where multiple Amazon Pay (or Sign In) buttons are rendered. By default, the module never renders more than one Amazon Sign In button anywhere, but I could definitely see an issue if a theme adds another one. Seems reasonable to include this for safety, also keeps consistency with the way the other button(s) are rendered.
If you'd like, you can fork this repo and create a PR with the fix from the patch you attached. We wouldn't directly merge the PR if we include the fix, but we would cherry pick your commit into a release so you'd receive credit for the contribution.
Thanks again! Spencer
@sgabhart22 Great, I openend the PR
Hello again @HenKun ,
Your fix has (finally) been included in version 5.15.0 of the module which is now available on the Magento Marketplace. We will be closing this issue and the related PR shortly. Thank you again for your contribution!
Spencer
This issue is related to @1096 but only solved for payment button, not for login button.
What I expected
Amazon Buttons (Login and Pay) render successfully
What happened instead
Js error
Uncaught AmazonPay: Can not find element #ui-id-4 for amazon.Pay.renderButton.
Steps to reproduce the issue
In our theme the Amazon login button is rendered via knockout JS.
Solution
Identically to the solution for issue @1096 it helps to wrap
in
view/frontend/web/js/amazon-login-button.js
on line 75 in a try-catch clause.Your setup