I preparted the code and put it under /app/addons/my_changes/controllers/frontend in checkout.post.php file.
I changed order status according to the payment method. So, if the customer chooses the payment method that ID is 3, the order status is changed and saved with new changed order status I set. For example if payment method 3 be selected, the order status “K” is saved.
Everything is OK till here. But, there is a problem about email: Content of order status marked with “O”, wich means OPEN, is being sent to customer as email. But I want content of order status “K” to be sent.
How can I provide the correct email is being sent?
I preparted the code and put it under /app/addons/my_changes/controllers/frontend in checkout.post.php file.
I changed order status according to the payment method. So, if the customer chooses the payment method that ID is 3, the order status is changed and saved with new changed order status I set. For example if payment method 3 be selected, the order status “K” is saved.
Everything is OK till here. But, there is a problem about email: Content of order status marked with “O”, wich means OPEN, is being sent to customer as email. But I want content of order status “K” to be sent.
How can I provide the correct email is being sent?
Note that even in this the customer will receive two e-mail. The first one will be default (with the Open status), and the second one is yours.
[/quote]
Thank you.
What is difference between “$force_notification” and “true” at the and of the code line?
I think, because I use php hook and add some more proccess except the core system of cs cart, the customer receive two emails. One is send by cs cart core system, one is send by the php hook I add.(above)
Question: How can I prevent customer from receiving two emails. I only want them receive correct status email, not OPEN status.
The 4th parameter means user notification flag (true/false), if not set, it is retrieved from status parameters.
It is better to use the change_order_status hook in the fn_change_order_status function which is located in the app/functions/fn.cart.php file for your needs.