Cool !
I end up changing the code also to transfer the points added on new account on the first purchase...since it was not processing this stuff....
Haven't check the sunrise period, but anyway I'm not using that either.
So on rewards admin extra functions I've changed this function... not sure if it's the best way, the smarter way, or if the script does this, but I can't find that piece of code anywere:
This is not entirely tested, got to go and watch the game against Croatia, but perhaps someone has a better idea...or something.
About the javascript in zc155, there are places where nothing works, others were it's ok.
PHP Code:
function TransferCustomerPointsFromPending($order_id)
{
global $messageStack, $db;
if(($record=GetLastRewardPointHistoryRecord($order_id)) && $record->fields['status']==STATUS_PENDING)
{
$customer_id=$record->fields['customers_id'];
$reward_points=$record->fields['reward_points'];
$pending_points=-$reward_points;
UpdateCustomerRewardPoints($customer_id,$reward_points,$pending_points);
UpdateRewardPointHistoryRecord($customer_id,$order_id,$reward_points,STATUS_PROCESSED);
$customer_pending_points = GetCustomersPendingPoints($customer_id);
if ( ($customer_pending_points) == abs(REWARD_POINTS_NEW_ACCOUNT_REWARD) ) {
$sql=$db->Execute("SELECT * FROM ".TABLE_REWARD_STATUS_TRACK." WHERE customers_id=".(int)$customer_id." and status =1");
if ($sql->RecordCount() >= 1 ) {
$updpoints = $reward_points + $customer_pending_points;
$sql=$db->Execute("UPDATE ".TABLE_REWARD_CUSTOMER_POINTS." SET pending_points=0 ,reward_points=".$updpoints." WHERE customers_id=".(int)$customer_id." ");
}
}
}
else
if(!$record)
$messageStack->add_session(WARNING_MISSING_RECORD.' '.$order_id, 'warning');
}
Bookmarks