This WooCommerce Order Received code simply allows you to check whether the page is the Order received condition simply checks to see if the page is the “Order Received” page and returns true if it is or false if it isn’t.
You can switch the true/false conditions manually as needed.
Go to Advanced > Conditions and select the Custom PHP condition. Then paste the code in the PHP Editor.
<?php
if ( is_checkout() && is_wc_endpoint_url('order-received') ) {
return true;
} else {
return false;
}
?>