• Resolved Abbas

    (@xllentech)


    Hi,
    I am using following code in cron job to schedule order and send email.. but it duplicates twice, can’t understand the reason.

    $clone_order_request = new CloneOrder;
    //for below code, I have added return $order_id in clone_order function.
    $new_order_id = $clone_order_request->clone_order( $originalorderid );

    $new_order = new WC_Order($new_order_id);
    if( $new_order ) {
    $new_order->update_status(‘processing’, ‘Cron action: Monthly recur:’);
    }

    Any help is appreciated. Thank you for the nice plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jamie Gill

    (@patchgill)

    Hi there,

    I am unsure why this would be, however I have not added in a hook for users to use the duplicate functionality outside of my plugin so you may experience issues here.

    You may need to use my plugin functionality to build your own here, as it seems you probably need bespoke funtionality.

    Many Thanks
    Jamie

    Thread Starter Abbas

    (@xllentech)

    Thank you for reply. Forgot to add update earlier.

    For other who might come across this, For me, it turned out to be issue with ISPconfig Alternate cron job. when I tested on different server, works as expected.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Duplicates twice when using in cron job’ is closed to new replies.