Created
January 12, 2017 05:17
-
-
Save GeoffEW/c83a84cb095de4ae00b731ec929c62c8 to your computer and use it in GitHub Desktop.
Should restore behaviour similar to the original snippet provided by Woo themselves
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 | |
function etp_woo_use_alternate_autocomplete_trigger() { | |
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) { | |
return; | |
} | |
$woo_provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
remove_action( 'woocommerce_payment_successful_result', array( $woo_provider, 'maybe_complete_order' ) ); | |
add_action( 'woocommerce_thankyou', 'etp_woo_alternate_autocomplete_listener' ); | |
} | |
function etp_woo_alternate_autocomplete_listener( $order_id ) { | |
$woo_provider = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
$woo_provider->maybe_complete_order( array(), $order_id ); | |
} | |
add_action( 'init', 'etp_woo_use_alternate_autocomplete_trigger' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment