Reward Points & Linnworks

Hi all, I'm having an issue with the reward points not applying to the customer account when my order management program (Linnworks) updates the order status to complete, the points apply fine if you update the order status via the admin.



I contacted Linnworks and they suggested that there must be something that is activated when the order status is updated (which I had already guessed myself lol).



After hours of searching I understand that when the database is updated to show the order status is complete the order status is marked as “C”, I checked this both in the admin and Linnworks and both of them do this without any problems, however, when updating via the admin something must notice the order update. Whatever that something is, does not run when Linnworks updates the order status, as Linnworks does this via changing the database directly.



The forums point to this piece of coding in the “func.php” file located in the “addons/reward_points” directory applying the points

if ($status_to == 'C' && $points_info['is_gain'] == 'N' && !empty($points_info['reward'])) {
// increase rewarded points
$log_id = fn_change_user_points($points_info['reward'], $order_info['user_id'], serialize($reason), $action);
$order_data = array(
'order_id' => $order_info['order_id'],
'type' => ORDER_DATA_POINTS_GAIN,
'data' => 'Y'
);
db_query("REPLACE INTO ?:order_data ?e", $order_data);




I can only guess that this file may be running in the background when you are logged in to your admin area and this is what notices that the order status has changed to “C”.



Can anyone confirm this or point me in the right direction please?