Jump to content

[SOLVED] How to set ratio to "Referral Program"? I want to have 2:1 ratio for sponsor:friend, e.g. 10USD(sponsor), 5USD(friend) in one order.


Recommended Posts

Hello,

Can I set 2:1 ratio to the "Referral Program"?
For example, existing client earns 10USD when new client placed the order.
Meanwhile, the new client also can earn 5USD for this order. not both earn 10USD.

Could anyone please teach me how to achieve it?
Many Thanks!

Link to comment
Share on other sites

Try changing line 83 of modules/referralprogram/ReferralProgramModule.php from:

$discount->value = floatval($configurations['REFERRAL_DISCOUNT_VALUE_'.(int)($id_currency)]);



to:

$discount->value = floatval($configurations['REFERRAL_DISCOUNT_VALUE_'.(int)($id_currency)]);
if ($register == 'sponsored')
  $discount->value = $discount->value / 2;

Link to comment
Share on other sites

Try changing line 22 of modules/referralprogram/referralprogram-program.php from:

$discount = Discount::display(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))), intval(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency));



to:

$discount = Discount::display(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))), intval(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency));
$half_discount = Discount::display(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))) / 2, intval(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency));



and line 144 from:

'discount' => $discount,



to:

'discount' => $discount,
'half_discount' => $half_discount,



and changing line 73 of modules/referralprogram/referralprogram-program.tpl from:

{l s='he or she will receive a' mod='referralprogram'} {$discount} {l s='voucher and you will receive your own voucher worth' mod='referralprogram'} {$discount}.



to:

{l s='he or she will receive a' mod='referralprogram'} {$half_discount} {l s='voucher and you will receive your own voucher worth' mod='referralprogram'} {$discount}.

Link to comment
Share on other sites

×
×
  • Create New...