Okay, I've noticed that since the integration of this mod, it seems as though the sunrises period is not being respected.
The function mentioned above is the entire reason why. I had noticed that a customer would place an order on the 5th and they'd have points rewarded by the 9th even though our sunrises = 31.
This function is moving points from pending to rewarded as soon as the admin makes comments on an order and gives a status other than "pending". This is double uncool because not all orders are marked as "pending" when placed.
Zencart gives us an option of the default status when an order is placed. We use "processing" for normal orders and "pending" for check/money order orders.
So the check for the status should dig a little deeper. Aside from that, we update orders regularly and normally starting on day 2 of the order with tracking info or other info about when their order may ship.
I have tweaked the function a bit. Now when an order is update it does nothing in regards to transferring points unless the status is one of our "refunded", "canceled", "google canceled" or "google refunded". In those cases it will now delete the status tracker record as well as rewarded or pending points == to the amount of points earned on that particular order.
You can see our order status id's above which will hopefully help the following code make sense.
function UpdateOrderRewardPointsStatus($order_id,$zc_status)
{
global $messageStack;
if(REWARD_POINTS_STATUS_TRACK==''){ // Simple mode
if($zc_status==5 || $zc_status==6 || $zc_status==107 || $zc_status==111){
DeleteOrderRewardPoints($order_id);}
}else{ // Advanced mode
if(($record=GetLastRewardPointHistoryRecord($order_id))){
if(($state=GetState($zc_status))!=STATUS_IGNORE && $status_change=($record->fields['status']!=$state)){
if($state==STATUS_PROCESSED){
TransferCustomerPointsFromPending($order_id);
}else{
TransferCustomerPointsToPending($order_id);}
}}}
}