Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('affiliates_record_referral', 'eggemplo_affiliates_record_referral', 10, 2);
- function eggemplo_affiliates_record_referral ($algo, $data) {
- if ( class_exists( 'WC_Order' ) ) {
- $order = new WC_Order();
- } else {
- $order = new woocommerce_order();
- }
- if ( $order->get_order( $data['post_id'] ) ) {
- if( $order->get_used_coupons() ) {
- $coupons_count = count( $order->get_used_coupons() );
- if ( $coupons_count>0 ) {
- return false;
- }
- }
- }
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement