PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

Button for amazon pay in mini cart does not appear #449

Closed gfemorris closed 2 years ago

gfemorris commented 2 years ago

The Amazon pay button does not appear in the mini cart automatically. Because the JS is dependent on this specific button with that counter id it's not working at all. I had to add the button manually in the mini cart to make it work.

Magento 2 (2.4.2-p2) + (payone-gmbh/magento-2: 3.4.1)

janteuber commented 2 years ago

Hello @gfemorris ,

Thanks for your request.

I have forwarded the issue and will get back to you as soon as there is news.

FatchipRobert commented 2 years ago

I can't reproduce this problem.

The Amazon Pay button is shown correctly in all my testing environments.

The div container the button is rendered in is added through this observer: https://github.com/PAYONE-GmbH/magento-2/blob/master/Observer/AddAmazonPayButton.php

There are some conditions in there that would lead to the button not being added, you could check those.

The mechanism there is a bit tricky, because the mini cart is not generated on page load but rather updated some time later through another mechanism. Thats why there is this "wait mechanism" for loading the Amazon widget javascript which adds the button: https://github.com/PAYONE-GmbH/magento-2/blob/master/view/frontend/templates/amazon/scripts.phtml#L55

gfemorris commented 2 years ago

Thanks, i will re-investigate. Could be that it's a specific issue of our setup because there are more things added to the mini cart which might interfere.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

gfemorris commented 2 years ago

I tested again with a vanilla magento and it seems it is an issue on our side.