set order status to offline payment

i have created a custom order status: “Awaiting payment” id “E”

When a user select payment method of money order, the order is should set to custom “Awaiting payment”. how can i do that?



i have added

$pp_response['order_status'] = 'E';
?>


(where “E” is “Awaiting payment”) to the money.tpl but it does not do anything. order is still set to “Open”



any help please!

I tried to figure the same thing. When we did that we just ended up changing the order from open to the custom status after it was made. The default status on orders unless paid will be set to Open.

You can’t use php syntax in a template file. If you must, you would do it as

{php} your php code here {/php}

not



I would probably do what you're trying to do by using a "change_order_status" php hook. I would test that there was no order['processor_id'] set and that the 'to_status' is 'O'. Then I would recursively call fn_change_order_status() using the 'to_status' as the 'from_status' and let the system do what it does with the finer points of changing an order's status.

Look for an example of using a PHP hook for change_order_status() in one of the addons to get an idea of how it's used/done.

i really don’t understand what you mean and how to do that

p.s.: {php} didn’t work

Sorry, can’t provide a tutorial here on how t use php hooks…