Created
April 10, 2014 08:05
-
-
Save qutek/10354331 to your computer and use it in GitHub Desktop.
Woocommerce Redirect After Clicking "Place Order" Button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*======================================================== | |
Custom Thankyou Page Woocommerce | |
Woocommerce snippest to redirect user after order sucessed | |
Place it to functions.php in theme directory | |
=========================================================*/ | |
add_action( 'woocommerce_thankyou', function(){ | |
global $woocommerce; | |
$order = new WC_Order(); | |
if ( $order->status != 'failed' ) { | |
wp_redirect( home_url() ); exit; | |
} | |
}); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment