I applied the Custom Status mod (including the inventory fix in post 6) and found inventory updates still did not work correctly. I made some changes and it now works fine in my V4.4.5 store. I'll share what I found in case others run into inventory accuracy issues like me.
I performed all the updates noted in this disussion. However, I had to modify some of the new code used in the /include/func/func.order.php as follows:
Find Original Code:
Code:
$send_notification = false;
if (
$status == 'P'
Change to:
Code:
$send_notification = false;
// Custom Order Status Code, Return Cancelled products to stock
if (
$status == "R"
&& $order['status'] != 'R'
&& $order['status'] != 'F'
&& $order['status'] != 'D'
) {
func_update_quantity($order_data['products'],true);
}
elseif (
$status == 'P'
I also had to add some extra code to accommodate some status changes that were missing in the original mod.
Find Original Code:
Code:
} elseif (
$status == 'D'
&& $order['status'] != 'D'
&& $order['status'] != 'F'
) {
Change to:
Code:
} elseif (
$status == 'D'
&& $order['status'] != 'D'
&& $order['status'] != 'F'
&& $order['status'] != 'R'
) {
Find Original Code:
Code:
} elseif (
$status == 'F'
&& $order['status'] != 'F'
&& $order['status'] != 'D'
) {
Change to:
Code:
} elseif (
$status == 'F'
&& $order['status'] != 'F'
&& $order['status'] != 'D'
&& $order['status'] != 'R'
) {
Many thanks to those that did all the hard work!