Jump to content

Variable sale commission percent in affiliate tracking code


Recommended Posts

Hello guys :)

 

My client asked me to help with the tracking code implementation for an affiliate program.

The code template was:

<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='//event.2parale.ro/events/salecheck?amount=__ADD_SALE_VALUE__&campaign_unique=4dc7a465c&com_percent=__ADD_AFFILIATE_SALE_COMMISSION_PERCENT__&confirm=f3edf5277c44d4e6&transaction_id=__ADD_TRANSACTION_ID__&description=__ADD_DESCRIPTION__'></iframe>

So I had 4 variables to customize (the ones in capital letters).

 

With the help of another thread solved Jedi-style  :ph34r:  by Vekia, I managed to get 3 out of 4 variables to work.

Thread is here: https://www.prestashop.com/forums/topic/250595-solved-affiliate-tracking-code/

 

The last one (and trickiest) is __ADD_AFFILIATE_SALE_COMMISSION_PERCENT__

My client has two different commissions: X% general commission and Y% for the SALE product category.

 

I asked for some help from the affiliate network on this matter and the answer was:

In the above example , if a user orders product A worth 10 EUR ( for which a commission of 10%) and product B worth 20 EUR ( 5% commission ) , the parameter__ADD_AFFILIATE_SALE_COMMISSION_PERCENT__ Is calculated as :

10% x 10 RON = 1 RON ( product A)
5% x 20 RON = 1 RON ( product B )
The total commission = 1 + 1 = 2 RON
Total order value = 10 RON + 20 RON = 30 RON
__ADD_AFFILIATE_SALE_COMMISSION_PERCENT__ = Total amount of commission / total amount of
order x 100 = 2/30 x 100 = 7 % (rounded )

 

 

Needless to say that this answer sunk my fleet :(

 

Question is:

how do I translate the above quoted instruction into a variable to be inserted in the tracking code successfully?

 

Thank you so much in advance for any help that may come this way :)

 

Edited by Attrexx (see edit history)
Link to comment
Share on other sites

  • 5 weeks later...
×
×
  • Create New...