Purple Posted May 31, 2010 Share Posted May 31, 2010 Hi,I wanna ask regarding referral program. when A refer B to purchase order in my webstore, B will get voucher automatically from referral program module. expiration date will be 1 year from the date when voucher generate.can i change expiration date to 1 week after he/she get the voucher? I realize that I can change expiration date at Tab Payment > Voucher but since the voucher generate automatically, it's not polite if I change expiration date when my new customer already saw the expiration date.-------------------second question: where can I set minimum purchase for using voucher from referral program?let's say I give them $10 voucher but minimum purchase to use the voucher is $50 so my buyer will pay $40 when he/she submit order.I wish I can do some way that automatically when prestashop generate the voucher not I set them one by one.please help me... and sorry for my bad englishthank you so much Link to comment Share on other sites More sharing options...
rocky Posted May 31, 2010 Share Posted May 31, 2010 Change line 84 (in PrestaShop v1.3) of modules/referralprogram/ReferralProgramModule.php from: $discount->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year to: $discount->date_to = date('Y-m-d H:i:s', time() + 604800); // + 1 week $discount->minimal = 50; Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 thank you so much, i will try it Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 one more question,in my default inviitaion email, I can't get the discount value (i attached pict) Get sponsored and win a discount voucher of {discount}! referralprogram-program.php line 25 $file = str_replace('{discount}', Discount::Display(floatval(Configuration::get('referralprogram_DISCOUNT_VALUE')), intval(Configuration::get('referralprogram_DISCOUNT_TYPE')), new Currency($cookie->id_currency)), $file); what's wrong with that? please help me Link to comment Share on other sites More sharing options...
rocky Posted May 31, 2010 Share Posted May 31, 2010 What version of PrestaShop are you using? Here's what I have on line 22 of modules/referralprogram/referralprogram-program.php in PrestaShop v1.2.5: $discount = Discount::display(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE')), intval(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency)); and in PrestaShop v1.3: $discount = Discount::display(floatval(Configuration::get('REFERRAL_DISCOUNT_VALUE_'.intval($cookie->id_currency))), intval(Configuration::get('REFERRAL_DISCOUNT_TYPE')), new Currency($cookie->id_currency)); and on line 82 in both: '{discount}' => $discount, Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 im using PrestaShop v1.2.5i already try the code, but i think the problem is my referralprogram-ivitation.html can not get the discount value. but the others that also use discount value can get it. for example, i attached the pictat page ..../modules/referralprogram/referralprogram-program.php << can get the discount value Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 omg.... what happen to this module, i just tried to send email from referral program, but i didn't received the invitation email >.<but yesterday i tried n success Link to comment Share on other sites More sharing options...
rocky Posted May 31, 2010 Share Posted May 31, 2010 I'm not sure what's happened to your module, but you should check the value in $discount. If that contains the correct discount, and '{discount}' => $discount is being passed in to the mail template, then the discount should display wherever {discount} is in the mail template. Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 ok.. thank you so much, i will check and report later Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 hi... i just wanna inform that I already try your suggestion and it worked well...thank you so much for helping Link to comment Share on other sites More sharing options...
rocky Posted May 31, 2010 Share Posted May 31, 2010 If your issue is resolved, please edit your first post and change [ASK] to [sOLVED]. Link to comment Share on other sites More sharing options...
Purple Posted May 31, 2010 Author Share Posted May 31, 2010 already changed the title thank you Link to comment Share on other sites More sharing options...
Proglamour Posted July 8, 2010 Share Posted July 8, 2010 I'm not sure what's happened to your module, but you should check the value in $discount. If that contains the correct discount, and '{discount}' => $discount is being passed in to the mail template, then the discount should display wherever {discount} is in the mail template. same case with my module. but just not appear in preview, in actual email its working. Link to comment Share on other sites More sharing options...
Proglamour Posted July 8, 2010 Share Posted July 8, 2010 another issue when send referral email, below is the email eg.Your friend xxx xxxx wants to sponsor you on Yourshop.com! << this link click-able and user will not authenticate if reg via this linkGet sponsored and win a discount voucher of RM 5.00!It's very easy to sign up. Just click here! << the user only authenticate with this linkWhen signing up, don't forget to provide the e-mail address of your sponsoring friend: [email protected]Am i right? Could be the above link also need to include {shop_url}{link} originally just {shop_url} Link to comment Share on other sites More sharing options...
cagliostro Posted October 26, 2010 Share Posted October 26, 2010 What happens if the 'customer friend' cancels the order?How do I cancel the discount to the sponsor?Should enter the start date of the voucher only for the sponsorbest regards Link to comment Share on other sites More sharing options...
silentRun Posted August 31, 2013 Share Posted August 31, 2013 Hello, I know that my question is not exactly related with the thread. But I am modifying the prestashop referral module a bit, in order to make the vouchers generated by referral system, "incompatible"with some other defaults voucher code I have... But looking on the cartRule class, I don't see any rule to find out how to do this .... any idea ? Thanks a lot in advance Link to comment Share on other sites More sharing options...
kamppa Posted July 6, 2017 Share Posted July 6, 2017 I'm using the latest version of the module and the changes needed to the code have changed a little: $cartRule->minimum_amount = 25; and $cartRule->date_to = date('Y-m-d H:i:s', time() + 1209600); // + 14 days Link to comment Share on other sites More sharing options...
Recommended Posts