From 5f6295264da0a4a27a137e1ebaa93119c20886bc Mon Sep 17 00:00:00 2001 From: Thomas Geiger Date: Thu, 16 Feb 2017 07:00:16 +0100 Subject: [PATCH] Adding WP filter to is_order_received_page() Many plugins and themes rely on is_order_received_page() to include special codes when the user places an order. Some plugins however alter the flow: Klarna checkout for example uses a completely custom checkout flow, some other plugins adds the option to the user to specify a WP page as "the" order received page instead of the WooCommerce default. All those plugins break codes where is_order_received_page() is being used. --- includes/wc-conditional-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-conditional-functions.php b/includes/wc-conditional-functions.php index f0e632f682c..ccaddd75c99 100644 --- a/includes/wc-conditional-functions.php +++ b/includes/wc-conditional-functions.php @@ -195,7 +195,7 @@ if ( ! function_exists( 'is_order_received_page' ) ) { function is_order_received_page() { global $wp; - return ( is_page( wc_get_page_id( 'checkout' ) ) && isset( $wp->query_vars['order-received'] ) ); + return apply_filters( 'woocommerce_is_order_received_page', ( is_page( wc_get_page_id( 'checkout' ) ) && isset( $wp->query_vars['order-received'] ) ) ); } }