I am newbie in php and don`t know much about it. Would appreciate if you can write me in details.
The problem: duplicating emails when purchasing an item. I will explain why and what I want to achieve below.
I made a woocommerce checkout in a way of pre-order. Means that:
1) when a client orders an item on site, I got it on back-end with status "processing", but without payment. Yet, functionally, it triggers as payment.
2) After that, I send him details to his email manually with a link - for payment.
3) Now, client click on link and press button to pay, choose his gateway and pays.
And here I got duplicating of email. Because, the button in checkout and the button in payment gateway share the same function - processing. Which triggers woocommerce to send email notification again. And I don`t need that.
I want to limit processing order status, which triggers an email notification to 1. So, if email notification sent once for processing, it shouldnt send anymore. But I don`t know how to made it in php. It must be some function or filter.
What I want to achieve is:
1) client order an item -> new email notification on his mail (processing);
2) he got link for payment -> new email notification (manual email sent);
3) client clicks on a button, pays -> filter applied and woocommerce don`t send processing email again (no email sent);
4) an order completed -> new email notification (completed).
Hope, I described it fine, so you could undestood my problem. Let me know if you need more details.
I know there are many options to make it other way and my logic isn`t correct on 100%. But I just need to achieve it with this.
Thank you.