EDIT:
I don’t really need to delete main order after all, I did some changes to the plugin and it suits me well. However, I do need to turn on “Completed” customer e-mails for suborders as well. At the moment it only works for main orders.
I’ve noticed in the plugin’s source code that you are preventing the New order e-mails for suborders, but I don’t know where exactly are “Completed” e-mails forbidden. Could you give me a hint?
Thank you very much.
Hello,
I’m glad you managed to adapt the plugin to your needs.
On line 110 of class-alg-mowc-order-manager.php you have this:
$send_to_sub_orders = get_option( Alg_MOWC_Settings_General::OPTION_EMAILS_SEND_SUB_ORDER, 'no' );
Probably if you change it to
$send_to_sub_orders = 'yes';
It will work
Hi there,
thank you! It works well. There are some scenarios when I don’t want to send the e-mails to suborders. I could block it with some hooks – what are some meta values that sub-orders have and main orders don’t, that I can use?
Also, did you notice the thread name and my first question? The suborders are not created automatically, only with the manual button press. Everything seems to be set just right. Do you know where the problem might be?
Thank you very much! 🙂
Hi,
Great 🙂
On class-alg-mowc-order-manager.php, try to replace this:
add_action( 'woocommerce_thankyou', array( $this, 'create_suborders_call_on_new_order' ), 1 );
by
add_action( 'woocommerce_checkout_order_processed', array( $this, 'create_suborders_call_on_new_order' ), 1 );
Main orders have this meta:
_alg_mowc_suborder
Suborders have this meta:
_alg_mowc_is_suborder
Thank you, works perfectly!
Great support, keep up the good work.