Skip to content

Instantly share code, notes, and snippets.

@danielbitzer
Last active Nov 22, 2021
Embed
What would you like to do?
[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