Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smart button & Pay Later messaging disappear on the cart page after changing shipping method (163) #288

Closed
Sirvijver opened this issue Sep 28, 2021 · 1 comment · Fixed by #607 or #635
Labels
bug Something isn't working parity
Milestone

Comments

@Sirvijver
Copy link
Collaborator

The problem
When changing the shipping method on the cart page, the PayPal button disappears until a site refresh or AJAX reload.
Any AJAX reload in the cart page will lead to the Pay Latter banner disappearing until the site was refreshed.

Steps to reproduce

  • set up a webshop with at least 2 shipping methods and at least 1 product
  • set up PayPal Payments as a payment method & enable button on the cart page
  • add a product to the cart and visit the cart page
  • change shipping in the cart from one to the other option --> paypal button disappears until site reload
  • change the item total and hit “update cart” to make the Pay Later messaging disappear

gif_recording2

Expected behaviour
When changing the shipping method, the button should stay hooked.
Also, any AJAX update on the site should cause the Lay Later messaging to be updated.

Possible cause
interestingly, applying the button to a different hook may cause it to not disappear upon changing shipping methods:
hook the cart page buttons after the cart to prevent it from disappearing upon changing shipping options (might require additional CSS for placement)
The button seemingly only disappears when hooked into woocommerce_proceed_to_checkout or woocommerce_after_cart_totals or some others, but woocommerce_after_cart causes the button to not disappear.

Workaround
interestingly, applying the button to a different hook may cause it to not disappear upon changing shipping methods:
hook the cart page buttons after the cart to prevent it from disappearing upon changing shipping options (might require additional CSS for placement)
The button seemingly only disappears when hooked into woocommerce_proceed_to_checkout or woocommerce_after_cart_totals or some others, but woocommerce_after_cart causes the button to not disappear.

@Sirvijver Sirvijver added the bug Something isn't working label Sep 29, 2021
@isabellainpsyde isabellainpsyde changed the title Smart button & Pay Later messaging disappear on the cart page after changing shipping method Smart button & Pay Later messaging disappear on the cart page after changing shipping method (163) Oct 7, 2021
@nicdwilson
Copy link

4959278-zen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment