Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('woocommerce_checkout_process', 'myfunction');
- function myfunction() {
- $order = wc_create_order();
- $order->add_product( wc_get_product($productid), 1); // This is an existing SIMPLE product
- $order->set_address( $address, 'billing' );
- $order->calculate_totals();
- $order->update_status("Completed", 'Order status', TRUE);
- }
Add Comment
Please, Sign In to add comment