Created
October 25, 2016 23:54
-
-
Save danielbitzer/015d57920e7c5162d651509b5a0b0556 to your computer and use it in GitHub Desktop.
Import referral coupons script
This file contains hidden or 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 | |
foreach( $users as $user_id ) | |
{ | |
// fetch the existing key | |
// please note that the key should NOT include the referral prefix | |
// so if your prefix is 'REF' then the final coupon here will be 'REF1234' | |
$key = '1234' | |
$object = new AW_Model_Referral_Advocate_Key(); | |
$object->advocate_id = $user_id; | |
$object->created = gmdate( 'Y-m-d H:i:s' ); | |
$object->advocate_key = $key; | |
$object->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment