Jump to content

[SOLVED] Birthday present module ...


pedes

Recommended Posts

I installaed the birthday present module, i configured it and setup a cronjob ... i got 2 customers with a birthday today, they get no email or some voucher

i need some help ...

how do i set up this birthday module ??
what did i forgot ?

i use PS Version 1.2.1.0

thnx,
Peter

Link to comment
Share on other sites

  • 2 months later...

I have a problem with birthday present module:
the vouchers are generated ok, but when the customer enters voucher code the message "voucher expired" appears, although the voucher shows validity of 12 months.

Could this be related to some warnings I get after cronjob:
"PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../classes/Cookie.php on line 67
PHP Notice: Undefined offset: 4 in /var/www/vhosts/../classes/Cookie.php on line 70
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../classes/Cookie.php on line 72
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../init.php on line 99
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../init.php on line 118
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../classes/Mail.php on line 96
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../classes/Mail.php on line 96
PHP Notice: Undefined index: HTTP_HOST in /var/www/vhosts/../classes/Mail.php on line 96
OK"

This error is really annoying since I have to include the voucher for the customer's order manualy through database... and it realy spoils the present for the customer :)

Maybe you have encountered the same problem and found a solution????

Link to comment
Share on other sites

  • 9 months later...

The solution is quite simple, however I searched for it for 1.5 years now... and I found it! The problem is that in birthdaypresent.php voucher name is always 'birthday' so prestashop creates the same voucher name for different customers, that is why the system thinks that the voucher is expired. Just change the line (somewhere around line 109) in birthdaypresent.php so it creates a unique voucher name every time, for example:

$voucher->name = date('Y').'BP'.$user['id_customer'];

That's it! Enjoy and have a lot of happy customers :)

Link to comment
Share on other sites

That's great you figured it out. It's a shame that it took so long to find it. What version of PrestaShop are you using? I was going to report this to the bug tracker, but when I checked the code in PrestaShop v1.3.1, it seems to be already fixed:

$voucher->name = 'BIRTHDAY-'.intval($voucher->id_customer).'-'.date('Y');

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...