Last active
September 14, 2022 11:12
-
-
Save danielbitzer/d017b5e7a1aaa0c1241dd4de258e6b82 to your computer and use it in GitHub Desktop.
[Refer A Friend] Programatically get a user's referral coupon/link
This file contains 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 | |
$user_id = 1; | |
$advocate = \AutomateWoo\Referrals\Advocate_Factory::get( $user_id ); | |
// Retrieve or generate a shareable referral coupon (coupon sharing only) | |
$advocate->get_shareable_coupon(); | |
// Retrieve or generate a shareable referral link (link sharing only) | |
$advocate->get_shareable_link(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment