Add Custom Order Status to WooCommerce

Beginner
✓ Tested
📅 September 20, 2025
⬇️ 0 Downloads
📋 0 Copies

This simple snippet adds a single “Ready for Pickup” order status to WooCommerce. Perfect for stores that offer pickup services and need to notify customers when their orders are ready for collection.

What does this code do?

The snippet creates a new order status called “Ready for Pickup” with a green color and package icon. When an order is changed to this status, the customer automatically receives an email notification.

Features:

  • Single “Ready for Pickup” status with green color
  • Package icon (📦) in admin interface
  • Automatic email notification to customers
  • Bulk action in order list
  • Order action in individual orders
  • Integration with WooCommerce reports
  • Clean, simple code

Email notification includes:

  • Order number
  • Customer name
  • Order date
  • Order total
  • Pickup instructions

Where it appears:

  • Admin order list with green color
  • Order edit pages
  • Bulk actions dropdown
  • Order actions dropdown
  • WooCommerce reports

⚠️ Important Warnings

⚠️ Always backup before adding custom order statuses
⚠️ Make sure your site can send emails (SMTP configured)
⚠️ Test email functionality with a real order first
⚠️ Email will be sent in plain text format
⚠️ Status will appear in all WooCommerce admin areas
⚠️ Some payment gateways might need specific status handling
⚠️ Check with your theme if custom colors don't appear
💻 PHP Code
/**
 * Add "Ready for Pickup" custom order status to WooCommerce
 * Simple single status with email notification
 * Prefix: tpsc_ (TP Snippet Collection)
 */

// ============================================
// REGISTER CUSTOM ORDER STATUS
// ============================================

// Register "Ready for Pickup" order status
add_action('init', 'tpsc_register_ready_pickup_status');
function tpsc_register_ready_pickup_status() {
    register_post_status('wc-ready-pickup', array(
        'label'                     => 'Ready for Pickup',
        'public'                    => true,
        'exclude_from_search'       => false,
        'show_in_admin_all_list'    => true,
        'show_in_admin_status_list' => true,
        'label_count'               => _n_noop('Ready for Pickup <span class="count">(%s)</span>', 'Ready for Pickup <span class="count">(%s)</span>'),
    ));
}

// ============================================
// ADD TO WOOCOMMERCE
// ============================================

// Add status to WooCommerce order statuses
add_filter('wc_order_statuses', 'tpsc_add_ready_pickup_status');
function tpsc_add_ready_pickup_status($order_statuses) {
    $order_statuses['wc-ready-pickup'] = 'Ready for Pickup';
    return $order_statuses;
}

// ============================================
// ADMIN STYLING
// ============================================

// Add custom styling for the status
add_action('admin_head', 'tpsc_ready_pickup_admin_styles');
function tpsc_ready_pickup_admin_styles() {
    echo '<style>
        mark.order-status.status-ready-pickup {
            background-color: #27ae60 !important;
            color: white !important;
        }
        mark.order-status.status-ready-pickup:before {
            content: "📦 ";
            margin-right: 3px;
        }
        .widefat .column-order_status mark.status-ready-pickup {
            background-color: #27ae60;
            border-radius: 4px;
            padding: 4px 8px;
            font-weight: bold;
        }
    </style>';
}

// ============================================
// BULK ACTIONS
// ============================================

// Add bulk action
add_filter('bulk_actions-edit-shop_order', 'tpsc_add_ready_pickup_bulk_action');
function tpsc_add_ready_pickup_bulk_action($bulk_actions) {
    $bulk_actions['mark_ready_pickup'] = 'Mark as Ready for Pickup';
    return $bulk_actions;
}

// ============================================
// ORDER ACTIONS
// ============================================

// Add order action in admin
add_filter('woocommerce_order_actions', 'tpsc_add_ready_pickup_order_action');
function tpsc_add_ready_pickup_order_action($actions) {
    $actions['change_status_ready_pickup'] = 'Change status to Ready for Pickup';
    return $actions;
}

// Process the order action
add_action('woocommerce_order_action_change_status_ready_pickup', 'tpsc_process_ready_pickup_action');
function tpsc_process_ready_pickup_action($order) {
    $order->update_status('ready-pickup', 'Order status changed to Ready for Pickup by admin.');
}

// ============================================
// EMAIL NOTIFICATION
// ============================================

// Send email when status changes to ready-pickup
add_action('woocommerce_order_status_changed', 'tpsc_send_ready_pickup_email', 10, 3);
function tpsc_send_ready_pickup_email($order_id, $old_status, $new_status) {
    if ($new_status !== 'ready-pickup') {
        return;
    }
    
    $order = wc_get_order($order_id);
    if (!$order) {
        return;
    }
    
    // Get customer email
    $customer_email = $order->get_billing_email();
    if (!$customer_email) {
        return;
    }
    
    // Email subject and message
    $subject = sprintf('Your order #%s is ready for pickup!', $order->get_order_number());
    
    $message = sprintf(
        "Hello %s,\n\nGreat news! Your order #%s is now ready for pickup.\n\nOrder Details:\n- Order Number: #%s\n- Order Date: %s\n- Total: %s\n\nPlease visit our store to collect your order.\n\nThank you for your business!",
        $order->get_billing_first_name(),
        $order->get_order_number(),
        $order->get_order_number(),
        $order->get_date_created()->format('F j, Y'),
        $order->get_formatted_order_total()
    );
    
    // Send email
    wp_mail($customer_email, $subject, $message);
    
    // Add order note
    $order->add_order_note('Ready for pickup email sent to customer.');
}

// ============================================
// REPORTS INTEGRATION
// ============================================

// Include in WooCommerce reports
add_filter('woocommerce_reports_order_statuses', 'tpsc_include_ready_pickup_in_reports');
function tpsc_include_ready_pickup_in_reports($statuses) {
    $statuses[] = 'ready-pickup';
    return $statuses;
}

📝 Installation Instructions

QUICK START:

Copy the entire code
Paste in functions.php
Go to WooCommerce → Orders
The new "Ready for Pickup" status will appear immediately!

TO CHANGE ORDER STATUS:
Method 1 - Individual Order:

Go to WooCommerce → Orders
Click on an order
Find "Order actions" dropdown
Select "Change status to Ready for Pickup"
Click "Update order"

Method 2 - Bulk Change:

Go to WooCommerce → Orders
Select multiple orders (checkboxes)
Use "Bulk actions" dropdown
Select "Mark as Ready for Pickup"
Click "Apply"

Method 3 - Order Status Dropdown:

Go to WooCommerce → Orders
Click on order status dropdown
Select "Ready for Pickup"
Status changes automatically

EMAIL CUSTOMIZATION:
To change the email message, find this part in the code:
$message = sprintf(
"Hello %s,\n\nYour custom message here...",
$order->get_billing_first_name()
);
Replace the text with your own message.
TO CHANGE STATUS COLOR:
Find this line: background-color: #27ae60
Change #27ae60 to any color:

Red: #e74c3c
Blue: #3498db
Orange: #f39c12
Purple: #9b59b6

TO CHANGE ICON:
Find this line: content: "📦 ";
Replace 📦 with any emoji: ✅ 🎯 🏪 📋 🔔
TESTING:

Create a test order
Change status to "Ready for Pickup"
Check that email was sent
Verify status appears with green color
Test bulk actions

📸 Screenshots

💬 Let's Connect and Share!

Got a question about this snippet?

Something not working as expected? Need help customizing it for your specific needs?

💡

Want to request a custom snippet?

Have an idea for functionality you're missing on your site? Tell us what you're looking for!

🤝

Have an awesome snippet you're using?

Share it with us! Our community loves learning and growing together.

No comments yet.

Leave a Comment

Leave a Comment

To leave a comment, please enter your email address. We will send you a verification code to confirm your identity.

Email Verification

We sent a 6-digit verification code to your email address. Please check your inbox and enter the code below:

Write Your Comment

Great! Your email is verified. Now you can write your comment:

Comment Submitted!