Skip to content

Commit

Permalink
Prevent rendering twice on order received page
Browse files Browse the repository at this point in the history
  • Loading branch information
gpressutto5 committed Feb 27, 2025
1 parent 61d44f5 commit 4cf13e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/class-wc-payments-order-success-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public function register_payment_method_override() {
* @param int $order_id The order ID.
*/
public function maybe_render_multibanco_payment_instructions( $order_id ) {
if ( is_order_received_page() && current_filter() === 'woocommerce_order_details_before_order_table' ) {
// Prevent rendering twice on order received page.
return;
}

$order = wc_get_order( $order_id );

if ( ! $order || $order->get_payment_method() !== 'woocommerce_payments_' . Payment_Method::MULTIBANCO || 'on-hold' !== $order->get_status() ) {
Expand Down

0 comments on commit 4cf13e3

Please sign in to comment.