Skip to content

Instantly share code, notes, and snippets.

@mycred
Created July 23, 2018 06:08
Show Gist options
  • Save mycred/7ca91d55aca1a1e3592d2c3545bb34c8 to your computer and use it in GitHub Desktop.
Save mycred/7ca91d55aca1a1e3592d2c3545bb34c8 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.
/**
* 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