Page 1 of 1

Adding Rewards to ALL Customer Accounts

Posted: Mon Dec 30, 2013 1:53 am
by acugraph
Hi,
We are running a promotion and we would like to add 20 reward points to all our existing customer accounts as a bonus.

Is there any extension that can do this? I have searched but cannot find one. Or can someone suggest another way to achieve this.

Thanks for your help.

Re: Adding Rewards to ALL Customer Accounts

Posted: Mon Dec 30, 2013 10:15 am
by MarketInSG

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer");

foreach ($query->rows as $result) {
	$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$result['customer_id'] . "', description = 'Happy holidays', points = '100', date_added = NOW()");
}

Re: Adding Rewards to ALL Customer Accounts

Posted: Tue Dec 31, 2013 5:00 am
by acugraph
Thanks for your help