How to Manually Add an Order in WooCommerce: A Step-by-Step Guide
Introduction:
WooCommerce is a powerful e-commerce platform, but sometimes you need to manually add an order. This might be because a customer placed an order over the phone, in person, or through a different channel. Manually adding an order allows you to keep all your sales records in one place and manage your inventory effectively. In this article, we’ll walk you through the process of manually creating an order in WooCommerce, explaining each step in detail. By the end of this guide, you’ll be able to confidently add orders manually and manage your online store more efficiently.
Main Part:
Why Manually Add an Order?
There are several situations where manually adding an order in WooCommerce can be beneficial:
- Offline Sales: If you sell products at a physical store or event, you can manually add those sales to WooCommerce for unified inventory and reporting.
- Phone Orders: Customers might call in to place an order. Manually adding the order allows you to process their request and maintain a complete record.
- Wholesale Orders: You might receive wholesale orders through a different system or directly from a client. Manual order entry keeps everything centralized.
- Testing and Development: When testing new features or integrations, manually creating orders can help you simulate real-world scenarios.
- Correcting Errors: Sometimes, an order might fail to process correctly through the standard checkout process. Manually adding the order allows you to rectify Check out this post: How To Add Video To Woocommerce Product the situation.
- Log in to your WordPress admin dashboard.
- Navigate to WooCommerce > Orders.
- Click the Add Order button at the top of the Orders page. This will take you to a blank order form.
- In the “General” section, you need to fill in the customer details. You have two options:
- Existing Customer: Start typing the customer’s name or email in the “Customer” field. WooCommerce will display matching customer accounts. Select the correct customer.
- New Customer: Click “Create a new customer” below the search box. This opens a form where you can enter the customer’s first name, last name, email address, and billing/shipping addresses. You can optionally create a new WordPress user account for them, which is recommended if they will be repeat customers.
- Set the initial order status using the “Status” dropdown. Common options include:
- Pending payment: Awaiting payment from the customer.
- Processing: Payment received, and the order is being prepared.
- Completed: Order fulfilled and shipped.
- On hold: Awaiting action, such as verification or further information.
- Cancelled: The order has been cancelled.
- Refunded: Payment has been refunded.
- Failed: The order failed to process.
- In the “Order items” section, click the “Add item(s)” button.
- A search box will appear. Start typing the name of the product you want to add.
- Select the product from the search results.
- Enter the quantity of the product.
- Click the “Add” button.
- Repeat these steps to add all the necessary products to the order.
- You can adjust the product price and quantity directly within the order item.
- Hover over the product in the “Order items” section.
- Click the pencil icon to edit the product details.
- Make your adjustments and click “Save”.
- If the order requires shipping, click the “Add shipping” button in the “Order items” section.
- Enter the shipping method, cost, and any other relevant details. You can manually enter the cost or choose a pre-configured shipping method.
- Click the “Save” button.
- If you need to add any additional fees (e.g., handling fees), click the “Add fee” button in the “Order items” section.
- Enter the fee name, amount, and whether it is taxable.
- Click the “Save” button.
- If the customer has a valid coupon, you can apply it to the order.
- Click the “Apply coupon” button.
- Enter the coupon code and click “Apply”.
- WooCommerce will automatically calculate the order total, including shipping, taxes, and discounts. Verify that the totals are correct.
- Use the “Order notes” section to add any internal notes about the order. You can also choose to send the note to the customer. This is useful for tracking communication and providing updates.
- Use the “Customer provided note” metabox to record any notes that the customer provided.
- Make sure you click on “Recalculate” button below the list of ordered items. This is important especially if tax settings were modified since the order was created.
- Once you’ve entered all the necessary information, click the “Create” or “Update” button to save the order. “Create” is used when first creating the order, and “Update” is used when modifying an existing order.
Step-by-Step Guide to Manually Adding an Order
1. Access the Orders Section:
2. Create a New Order:
3. Customer Details:
4. Order Status:
5. Adding Products:
6. Adjusting Product Details (Optional):
7. Adding Shipping:
8. Adding Fees (Optional):
9. Applying Coupons (Optional):
10. Order Totals:
11. Order Notes:
12. Calculate Tax:
13. Save the Order:
Code Example: Programmatically Creating an Order
While this article focuses on manual order creation, it’s helpful to know that you can also create orders programmatically using PHP. Here’s a simplified example:
<?php // Create a new order object $order = wc_create_order();
// Set customer ID (if applicable)
$customer_id = 123; // Replace with the actual customer ID
$order->set_customer_id( $customer_id );
// Add product(s) to the order
$product_id = 456; // Replace with the actual product ID
$quantity = 2;
$order->add_product( wc_get_product( $product_id ), $quantity );
// Set billing and shipping addresses
$address = array(
‘first_name’ => ‘John’,
‘last_name’ => ‘Doe’,
‘address_1’ => ‘123 Main Street’,
‘city’ => ‘Anytown’,
‘postcode’ => ‘12345’,
‘country’ => ‘US’,
’email’ => ‘[email protected]’,
‘phone’ => ‘555-123-4567’,
);
$order->set_billing_address( $address );
$order->set_shipping_address( $address );
// Calculate totals
$order->calculate_totals();
// Save the order
$order->save();
// Get the order ID
$order_id = $order->get_id();
echo “Order created with ID: ” . $order_id;
?>
Important considerations when programmatically creating orders:
- Error Handling: Always include robust error handling to catch potential issues.
- Security: Sanitize and validate all input data to prevent security vulnerabilities.
- WooCommerce API: Utilize the WooCommerce API for more complex tasks.
Conclusion:
Manually adding an order in Explore this article on Woocommerce How To Add A Variation Level To Variable Levels WooCommerce is a straightforward process that can be incredibly useful in various scenarios. Whether you’re dealing with offline sales, phone orders, or simply need to correct an error, this feature allows you to maintain a comprehensive and accurate record of all your transactions. By following the steps outlined in this guide, you can effectively manage your WooCommerce store and streamline your order management workflow. Remember to carefully review all details before saving the order to ensure accuracy and a smooth customer experience.