Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tharlab/ee478da4db85d7bfe6ec8fcd5cb752f1 to your computer and use it in GitHub Desktop.
Save tharlab/ee478da4db85d7bfe6ec8fcd5cb752f1 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