From 540480e2086e75a8e63c524d6c97158181c695e3 Mon Sep 17 00:00:00 2001 From: Timur Karimov Date: Fri, 12 Jul 2024 16:33:54 +0200 Subject: [PATCH] Update deprecated checkout hook (#9093) --- changelog/fix-deprecate-notice | 4 ++++ includes/class-woopay-tracker.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog/fix-deprecate-notice diff --git a/changelog/fix-deprecate-notice b/changelog/fix-deprecate-notice new file mode 100644 index 00000000000..3abbe23b422 --- /dev/null +++ b/changelog/fix-deprecate-notice @@ -0,0 +1,4 @@ +Significance: minor +Type: dev + +Avoid using deprecated hook for processed checkout order. diff --git a/includes/class-woopay-tracker.php b/includes/class-woopay-tracker.php index 86a00a3ab08..75ca5ecf3bc 100644 --- a/includes/class-woopay-tracker.php +++ b/includes/class-woopay-tracker.php @@ -71,7 +71,7 @@ public function __construct( $http ) { add_action( 'woocommerce_blocks_enqueue_checkout_block_scripts_after', [ $this, 'blocks_checkout_start' ] ); add_action( 'woocommerce_blocks_enqueue_cart_block_scripts_after', [ $this, 'blocks_cart_page_view' ] ); add_action( 'woocommerce_checkout_order_processed', [ $this, 'checkout_order_processed' ], 10, 2 ); - add_action( 'woocommerce_blocks_checkout_order_processed', [ $this, 'checkout_order_processed' ], 10, 2 ); + add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'checkout_order_processed' ], 10, 2 ); add_action( 'woocommerce_payments_save_user_in_woopay', [ $this, 'must_save_payment_method_to_platform' ] ); add_action( 'before_woocommerce_pay_form', [ $this, 'pay_for_order_page_view' ] ); add_action( 'woocommerce_thankyou', [ $this, 'thank_you_page_view' ] );