• Resolved RobFenech

    (@terydinho)


    I have a site where orders can be created programatically:

    $args = array(
        'status' => 'processing',
        'customer_note' => 'free sample',
        'created_via' => 'sample request'
      );
      $order = wc_create_order($args);

    How would I then go about changing the delivery date to 3 days time automatically? It defaults to 1st Jan, 1970

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RobFenech

    (@terydinho)

    If anybody else is having a similar issue, here is how I fixed it:

    $args = array(
        'status' => 'processing',
        'customer_note' => 'free sample',
        'created_via' => 'sample request'
      );
      $order = wc_create_order($args);
      $deliveryDateSelector = Date('j F, Y', strtotime('+3 days'));
      update_post_meta($order->id,'Delivery Date', $deliveryDateSelector);

    So far, so good.

    Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi @terydinho,

    Thank you for sharing the solution here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add delivery date to manually created order’ is closed to new replies.