Jump to content

How to Generate the Promotion & Coupon and Assign it to Specific Affiliate


Recommended Posts

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

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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).

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated