Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Last active September 14, 2022 11:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielbitzer/d017b5e7a1aaa0c1241dd4de258e6b82 to your computer and use it in GitHub Desktop.
Save danielbitzer/d017b5e7a1aaa0c1241dd4de258e6b82 to your computer and use it in GitHub Desktop.
[Refer A Friend] Programatically get a user's referral coupon/link
<?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