Syed Ans Shah Posted May 16, 2019 Share Posted May 16, 2019 hi, i want to know if there is any process or any way to create a Promotion and assign it to specific Affiliate i have generated a promo promocode=TestPromo and i have an affiliate as ?aff=10 Now i want to assign all the user/clients who uses that promo to be assigned to the Affiliate and gets the specified commision. help required immediately please. thanks 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 16, 2019 Share Posted May 16, 2019 Pseudo-code: On InvoicePaid if TestPromo coupon has been used and the invoice is linked to a new order... INSERT INTO tblaffiliatesaccounts (affiliateid, relid) VALUES ({$AFFID}, {$RELID}) Where {$AFFID} in your example is 10 (the ID of the Affiliate) and {$RELID} is the ID of the order (tblorders.id). 1 Quote Link to comment Share on other sites More sharing options...
Syed Ans Shah Posted May 17, 2019 Author Share Posted May 17, 2019 thanks @Kian but what if i dont know the affID. my use case is this: i want to make a PromoCode for each affiliate. NOW new Client subscribes to my service using that promoCode and i want to give the commission of this client to that affiliate. so how will the affiliate gets this commission. i dont want to use the affiliate link. i want to use promo codes for affiliate. any suggestions? 19 hours ago, Kian said: Pseudo-code: On InvoicePaid if TestPromo coupon has been used and the invoice is linked to a new order... INSERT INTO tblaffiliatesaccounts (affiliateid, relid) VALUES ({$AFFID}, {$RELID}) Where {$AFFID} in your example is 10 (the ID of the Affiliate) and {$RELID} is the ID of the order (tblorders.id). 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 17, 2019 Share Posted May 17, 2019 On AffiliateActivation create the coupon code... INSERT INTO tblpromotions (code, [...etc...]) VALUES ({$COUPON}, [...etc...]) {$COUPON} should contain the ID of the affiliate in some ways (eg. Affiliate ID is 24 - Coupon code is 24AAABBB). This way you can determine the what is the right coupon to use for each affiliate by simply looking at digits. Alternatively if you don't want to store the ID in the code you'll need to create a separate table that stores the connection between 24 and AAABBB. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.