You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
The Order Confirmation Block passes an order object when it triggers the woocommerce_before_thankyou hook even though WooCommerce has always passed an order ID in the thankyou.php template, which is now leading to type conflicts.
To reproduce
Steps to reproduce the behavior:
Implement a function that expects an integer for the order ID, attached to the woocommerce_before_thankyou hook. Example function:
functionexample_function( int$order_id ): void {
// Function logic that expects $order_id to be an integer
}
add_action( 'woocommerce_before_thankyou', 'example_function' );
Place an order on the WooCommerce store.
Observe the behavior during the "Thank You" page load, which results in a type error due to the function expecting an integer but receiving an object instead.
Expected behavior
The expected behavior is for the woocommerce_before_thankyou hook to maintain backward compatibility by passing an order ID (integer).
Environment
WordPress (please complete the following information):
WordPress version: 6.4.1
WooCommerce version: 8.3.0
Site language: English
Any other plugins installed: Google Listings & Ads
Desktop (please complete the following information):
OS: macOS
Browser: chrome
Version: 119.0.6045.159
Additional context
We're running into this on a Team51 partner site. We noticed this issue when the Google Listings & Ads plugin threw a fatal after a recent WooCommerce update.