Created
April 3, 2020 18:26
-
-
Save alexstandiford/e2cb4eb2e4a940d921d07c1c2ec54638 to your computer and use it in GitHub Desktop.
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 | |
// Manipulate referral that was just created for the specified order ID | |
// This example is WooCommerce-specific. The action used is based on whatever action is used to run 'get_pending_referral' in your integration class. | |
// Integration class is located in includes/integrations/ | |
add_action( 'woocommerce_checkout_update_order_meta',function( $order_id ){ | |
$referral = affilite_wp()->referrals->get_by('reference',$order_id); | |
if( $referral ){ | |
// Change referral based on params here. | |
} | |
}, 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment