Customer Behavior Rule - Triggers - Birthday Points

This trigger happens when a customer's birthday has occurred. This only works if the customer has specified their birthday.


Follow these steps to add the birth date to your store's signup form:

Magento Community Edition

  • Backend > System > Customers > Customer Configuration > Name and Address Options > Show Date of Birth

Magento Enterprise

  • Customer >> Attributes >> Manage Customer Attributes >> dob
    Show in front end >> Yes

Selecting options; optional or required, will cause the date of birth option to be available to customers while signing-up.

Magento Community Edition 1.6 alpha1 and newer.

Hot fix for Magento 1.5.x

This unofficial, unsupported hotfix will temporarily fix the problem until you upgrade your Magento store to the latest version. Just replace line 437 in your js/varien/js.js file with the highlighted replacement:

this.year.setAttribute('autocomplete','off');<br> <br> this.advice.hide();<br> },<br> validate: function() {<br> var error = false, day = parseInt(^0*/, '')) || 0, month = parseInt(this.month.value.replace(/^0*/, '')) || 0, year = parseInt(this.year.value) || 0;<br> if (!day && !month && !year) {<br> if (this.required) {<br> error = 'This date is a required value.';<br> } else {<br> this.full.value = '';<br> }

Missed Birthday Awards

In MageRewards and lower, some customers would miss out on their birthday points when they were supposed to be rewarded. A fix to this has been included with, along with diagnostic tools to check if any of your customers did not earn birthday points on their birthday. This tool will also allow you to automatically award the proper quantity of points to all those customers at the click of a link. You can run these diagnostics by logging into your Magento Backend, then going through the menu to "Rewards" > "Configuration" > "Other Configuration", then clicking the button found at "Diagnostics & Support Tools" > "Run 'Test Suite' Diagnostics". You can then find the results of the test under the heading  Check birthday points.

Technical details

In order to check if customers have earned their birthday points, Test Suite gets a list of all  active birthday points-rules, then goes through each year since the rule's start date until its effective end date (which is either the rule's actual end date or the present date, whichever is earlier), then checks each customer whose birthday falls within that span. This determines the number of the birthdays for which the customer should have been rewarded. Then, Test Suite gathers all birthday points-transfers for the customer that appear to be for that rule, and if the customer has fewer transfers than they have had birthdays, that means one or more of the birthdays did not successfully earn points.

This behaviour was caused by an attempt to access a block from the context of the cron. Birthday points are checked each day using the cron, which does not include a controller action context since there is no controller action involved with it. The standard method of instantiating a block (through the controller action) failed and ended the cron process before points could be awarded. The block was being accessed to compile a points string to display the earnings to the customer in an email. We now instantiate the block through the core layout object, which is always available, regardless of context.

Still need help? Get Help Get Help