I have a question on customization. Not confident enough to through this up on a live site. Unfortunately we are in a slow move from one server to the next. But with free migration I can't complain.
Anyways I want to not write points to the table_reward_customer_points if the email address contains a certain domain. I'm pretty sure I would change the catalog/includes/functions/extra_functions/reward_points_functions.php file. Specifically
Code:
function UpdateCustomerRewardPoints($customer_id,$reward_points,$pending_points)
{
global $db;
$sql="INSERT INTO ".TABLE_REWARD_CUSTOMER_POINTS." VALUES ('".$customer_id."', '".$reward_points."', '".$pending_points."') ON DUPLICATE KEY UPDATE reward_points=reward_points+".$reward_points.", pending_points=pending_points+".$pending_points.";";
$db->Execute($sql);
}
I'm thinking something like
Code:
function UpdateCustomerRewardPoints($customer_id,$reward_points,$pending_points)
{
global $db;
if (strpos($order->info['customer_email_address'],'@domain.com') == false) {
$sql="INSERT INTO ".TABLE_REWARD_CUSTOMER_POINTS." VALUES ('".$customer_id."', '".$reward_points."', '".$pending_points."') ON DUPLICATE KEY UPDATE reward_points=reward_points+".$reward_points.", pending_points=pending_points+".$pending_points.";";
$db->Execute($sql);
}
}
Can someone verify my logic here and let me know if I'm on the right track? Is the variable "$order->info['customer_email_address']" even available at this point? Thank you.
Bookmarks