Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Attempt to generate a coupon code
- $coupon_code = $this->generate_coupon( $user_id, $coupon_total );
- // If a coupon code was successfully generated, apply it
- if( $coupon_code ) {
- WC()->cart->add_discount( $coupon_code );
- wp_redirect( remove_query_arg( 'affwp_wc_apply_credit' ) ); exit;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement