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

woocommerce_receipt_ doesn't run in the block-based checkout #47349

Open
jimjasson opened this issue May 10, 2024 · 2 comments
Open

woocommerce_receipt_ doesn't run in the block-based checkout #47349

jimjasson opened this issue May 10, 2024 · 2 comments
Labels
focus: checkout Issues related to checkout page. needs: discussion Issue that either needs discussion or pending decision (not for support requests). priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: enhancement The issue is a request for an enhancement.

Comments

@jimjasson
Copy link
Contributor

jimjasson commented May 10, 2024

Describe the solution you'd like

The woocommerce_receipt hook doesn't run in the block-based checkout. This action is part of the checkout/order-receipt.php template that is rendered only in the legacy checkout -- before the payment is completed.

This action was particularly useful for payment gateways that want to render a 2FA form or a custom payment form before the order is submitted but after the Place Order button is clicked. Here's an example.

@jimjasson jimjasson added the type: enhancement The issue is a request for an enhancement. label May 10, 2024
@lanej0 lanej0 added focus: checkout Issues related to checkout page. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues labels May 13, 2024
@ralucaStan
Copy link
Contributor

p1715262073966669-slack-C8X6Q7XQU

@ralucaStan ralucaStan added needs: discussion Issue that either needs discussion or pending decision (not for support requests). priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. labels Jul 17, 2024
@opr
Copy link
Contributor

opr commented Jul 17, 2024

To summarise this issue and add a little more context, the woocommerce_receipt hook may be used by extensions to show content, e.g. a 2FA form or a custom payment form before the order is submitted but after the Place Order button is clicked.

We discussed recommending the woocommerce_thankyou hook as an alternative, but it may be unsuitable as it runs at a different time in the WordPress lifecycle, but investigating that could be part of solving the issue.

There are three possible approaches to solving this:

  • Reimplement the woocommerce_receipt hook with the caveat that it may run at a different time in the lifecycle
  • Add guidance to extension developers to suggest using woocommerce_thankyou.
  • Add guidance to extension developers about adding custom blocks in the block-based order confirmation.

A related discussion happened here: #48126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: checkout Issues related to checkout page. needs: discussion Issue that either needs discussion or pending decision (not for support requests). priority: normal The issue/PR is of normal priority—not many people are affected or there’s a workaround, etc. team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants