Skip to content

Instantly share code, notes, and snippets.

@alexstandiford
Created April 3, 2020 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexstandiford/e2cb4eb2e4a940d921d07c1c2ec54638 to your computer and use it in GitHub Desktop.
Save alexstandiford/e2cb4eb2e4a940d921d07c1c2ec54638 to your computer and use it in GitHub Desktop.
<?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