Magento Migrate Reward Points into Aheadworks Points and Rewards

Posted on February 22, 2016
Written by

Migrating data into Magento can always be a pain. So I wrote a quick script that enabled you to go through a csv of email address and rewards points balances and import them into Aheadworks Points and Rewards.

I imagine it would only be a small adjustment to get this to work with points and rewards module shipped with Magento Enterprise but that wont be covered here.

Firstly, your CSV file has to be formatted like this but without the table headers :

Email Address Points Balance
test@example.com 500
test+2@example.com 200
test+3@example.com 100
test+4@example.com 10

The script goes through each line in the csv and looks up the customer by the email address and only updates customers that exist in Magento.

I called my CSV file ‘test-csv.csv’ you will need to update the below script to match what you called it.

Add a php file called update-points.php to your magneto root and paste the following code :

This file can be ran by running php update-points.php from your magento root directory you should see something like this :

update points output

Magento Migrate Reward Points into Aheadworks Points and Rewards