• Resolved AHOiREKLAMA

    (@ahoireklama)


    Even though I have the “Creates suborders automatically when new orders are created” option checked, suborders are never created automatically. However, when I click the “Create suborders” button in order details admin page, it works well.

    Another question is: Is there a way to automatically delete the main order and keep only the suborders? (possibly in Pro version?)

    Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter AHOiREKLAMA

    (@ahoireklama)

    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

    Thread Starter AHOiREKLAMA

    (@ahoireklama)

    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

    Thread Starter AHOiREKLAMA

    (@ahoireklama)

    Thank you, works perfectly!
    Great support, keep up the good work.

    Great ??
    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Suborders are not created automatically’ is closed to new replies.