Created
July 26, 2018 09:45
-
-
Save mycred/a719353744b608276433728a663806b1 to your computer and use it in GitHub Desktop.
By default myCRED will payout points for WooCommerce orders when an order has been marked as "paid". This means that no points will be paid out if a users pays using a manual gateway such as Check or Bank Transfers. This code snippet will force myCRED to payout when an order has been marked as "Completed" instead of paid.
This file contains 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
/** | |
* Adjust myCRED Point Rewards | |
* Will move the points payout from when an order is "paid" to when | |
* an order is "completed". | |
* @version 1.0 | |
*/ | |
add_action( 'after_setup_theme', 'mycred_pro_adjust_woo_rewards', 110 ); | |
function mycred_pro_adjust_woo_rewards() { | |
remove_action( 'woocommerce_payment_complete', 'mycred_woo_payout_rewards' ); | |
add_action( 'woocommerce_order_status_completed', 'mycred_woo_payout_rewards' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment