Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/amirrezashf/woocommerce-order-status-buttons/archive/refs/heads/main.zipConvert the WooCommerce admin order-status dropdown into a modern, searchable button interface while preserving WooCommerce's native save workflow.
Overview
WooCommerce normally displays the order status as a standard dropdown on the order edit screen. This works well for stores with only a few statuses, but it becomes slow and inconvenient when a store uses many custom statuses.
WooCommerce Order Status Buttons replaces that dropdown with a searchable grid of buttons.
The plugin does not change WooCommerce's order-saving logic. It keeps the original status field in the page, updates that field when an administrator selects a button, and lets WooCommerce process the actual status change when the order is saved.
The currently saved order status is also shown in a separate highlighted panel. Selecting another status does not change this panel until the order is actually updated.
Features
- Replaces the WooCommerce order-status dropdown with buttons
- Adds instant search across available statuses
- Displays the currently saved order status separately
- Keeps the current-status panel unchanged until the order is saved
- Uses WooCommerce's original status field
- Preserves WooCommerce's native update workflow
- Supports built-in and custom order statuses
- Supports classic WooCommerce order storage
- Supports WooCommerce High-Performance Order Storage
- Detects dynamically rendered order edit screens
- Includes responsive desktop and mobile layouts
- Loads only on WooCommerce order edit screens
- Does not create database tables
- Does not store custom settings or metadata
- Uses a single PHP plugin file
- Requires no configuration after activation
Why This Plugin Is Useful
Stores may use many custom order statuses for workflows such as:
- Payment verification
- Preparing the order
- Packaging
- Warehouse processing
- Ready for shipment
- Delivered to courier
- Waiting for customer response
- Internal review
- Refund review
- Custom fulfillment steps
A long dropdown makes finding the correct status difficult. This plugin makes the available statuses visible and searchable without changing WooCommerce's underlying behavior.
How It Works
When an administrator opens an order edit screen, the plugin:
- Confirms that the current user can manage WooCommerce orders.
- Detects whether the screen uses classic order storage or HPOS.
- Locates WooCommerce's original order-status select field.
- Reads all available status options from that field.
- Hides the visible dropdown interface.
- Builds a searchable button grid from the same options.
- Displays the saved status in a separate current-status panel.
- Updates the original select field when a status button is clicked.
- Leaves the actual order update to WooCommerce.
The plugin does not submit the order automatically.
The administrator must still click WooCommerce's normal Update or Save button.
Current Status Behavior
The panel above the status buttons displays the status that was saved when the page loaded.
For example, assume the saved status is:
Processing
The current-status panel displays:
Current Order Status: Processing
If the administrator selects:
Completed
the Completed button becomes active, but the current-status panel still displays:
Current Order Status: Processing
After the order is saved and the page reloads, the panel displays:
Current Order Status: Completed
This behavior clearly separates:
- The currently saved status
- The status selected for the next update
Search Behavior
The search field filters the available status buttons immediately.
For example, entering:
pack
may display:
- Packaging
- Ready for Packaging
Statuses that do not contain the search term are temporarily hidden.
If no status matches the query, the plugin displays a message indicating that no result was found.
Supported Admin Screens
Classic Order Storage
wp-admin/post.php?post=123&action=edit
High-Performance Order Storage
wp-admin/admin.php?page=wc-orders&action=edit&id=123
The plugin automatically detects the active screen.
Custom Order Status Support
The plugin does not maintain its own fixed list of statuses.
Instead, it reads the existing options from WooCommerce's original order-status field. This means statuses added by compatible plugins or custom code are automatically included.
Examples include statuses registered through:
- Custom WooCommerce code
- Order workflow plugins
- Fulfillment plugins
- Shipping plugins
- Custom order status extensions
Save Workflow
The plugin does not save orders through AJAX and does not call a custom endpoint.
When a status button is selected, the plugin:
- Changes the value of the original WooCommerce status field.
- Triggers the normal change event on that field.
- Waits for the administrator to save the order.
WooCommerce remains responsible for:
- Capability checks
- Status validation
- Order persistence
- Status transition hooks
- Stock-related behavior
- Customer email notifications
- Administrative email notifications
- Third-party integrations
- Order notes related to status changes
Responsive Interface
Desktop
- Two-column status grid
- Scrollable status area
- Sticky search field
- Highlighted active status
- Separate current-status panel
Mobile
- Single-column status grid
- Full-width current-status panel
- Larger touch-friendly buttons
- Centered labels
- Responsive spacing
Performance
The plugin loads its CSS and JavaScript only when all of the following conditions are met:
- The request is inside the WordPress administration area
- The user has permission to manage or edit orders
- The current page is a WooCommerce order edit screen
- A valid order ID is available
The plugin does not load on:
- WordPress dashboard
- Product edit screens
- Post or page edit screens
- WooCommerce settings
- WooCommerce reports
- Frontend pages
- Product pages
- Cart
- Checkout
- Customer account pages
- Thank You page
Security
The plugin:
- Blocks direct access to the PHP file
- Checks order-management capabilities
- Sanitizes query-string parameters
- Confirms that the current page is an order edit screen
- Passes JavaScript settings through
wp_json_encode() - Does not create public AJAX actions
- Does not create REST API routes
- Does not write directly to the database
- Does not bypass WooCommerce validation
- Does not automatically submit order changes
- Does not expose order information on the frontend
Data Storage
The plugin stores no custom data.
It does not create:
- Custom database tables
- WordPress options
- Transients
- User metadata
- Order metadata
- Scheduled tasks
- Log files
All status changes are stored through WooCommerce's normal order update process.
HPOS Compatibility
The plugin declares compatibility with WooCommerce High-Performance Order Storage using WooCommerce's official compatibility declaration.
It does not access order database tables directly.
The interface works with:
- Classic WordPress post-based order storage
- WooCommerce HPOS order storage
Requirements
- PHP 7.4 or later
- WordPress 6.0 or later
- WooCommerce
- A user account with permission to edit WooCommerce orders
Installation
- Download the plugin ZIP file.
- In WordPress, open Plugins → Add New Plugin.
- Select Upload Plugin.
- Upload the ZIP file.
- Select Install Now.
- Activate the plugin.
- Open a WooCommerce order in the WordPress administration panel.
Manual Installation
- Extract the plugin ZIP file.
- Upload the plugin directory to:
wp-content/plugins/
- Open the WordPress Plugins page.
- Activate WooCommerce Order Status Buttons.
File Structure
WooCommerce-Order-Status-Buttons/
├── woocommerce-order-status-buttons.php
├── README.md
└── LICENSE
Usage
- Open WooCommerce → Orders.
- Select an order.
- Locate the order-status section.
- Use the search field when necessary.
- Select the required status button.
- Review the selected button.
- Save or update the order.
Troubleshooting
The buttons do not appear
Check the following:
- WooCommerce is installed and active.
- You are editing an existing WooCommerce order.
- Your user account can manage WooCommerce orders.
- The order edit screen contains WooCommerce's original status field.
- Another plugin has not removed or completely replaced the original field.
- Browser JavaScript is enabled.
- The administration page has no JavaScript errors.
The selected status is not saved
Selecting a button does not save the order automatically. After selecting a status, use WooCommerce's normal Update or Save button.
The current-status panel does not change after selecting a button
This is intentional. The panel shows the status currently saved in the database and changes only after the order is saved and the page reloads.
A custom status is missing
Confirm that the status is registered correctly and appears in WooCommerce's original selector.
The original dropdown is briefly visible
On dynamically rendered HPOS screens, WooCommerce may render the field shortly before the plugin initializes. The plugin uses a MutationObserver and additional initialization checks to reduce this behavior.
Compatibility Notes
Compatibility may be limited when another plugin:
- Removes the original WooCommerce status field
- Replaces the field with a completely custom interface
- Saves status changes through a proprietary workflow
- Prevents the original field from triggering its normal change event
- Changes the edit-screen markup extensively
Accessibility
The interface includes:
- Native HTML buttons
- Keyboard-focusable controls
- Visible focus states
- Search input
- High-contrast active state
- Responsive layout
- Clear current-status presentation
Browser Support
The plugin is designed for modern browsers supported by current WordPress and WooCommerce administration interfaces.
It uses:
- WordPress-provided jQuery
MutationObserver- Standard DOM APIs
- CSS Grid
- Modern media queries
Hooks and Filters
Version 1.0.0 does not add custom public filters or actions.
The plugin intentionally relies on WooCommerce's original status field and save workflow so existing WooCommerce hooks continue to run normally.
Relevant hooks may include:
woocommerce_order_status_changed
woocommerce_order_status_{$from}_to_{$to}
woocommerce_order_status_{$to}
Privacy
The plugin does not collect, transmit, or store personal information.
It does not:
- Send external requests
- Use analytics
- Add tracking scripts
- Store administrator activity
- Store customer data
- Communicate with third-party services
Changelog
1.0.0
- Initial release
- Added searchable order-status button grid
- Added separate current-status panel
- Preserved WooCommerce's native save workflow
- Added support for built-in and custom statuses
- Added classic order edit-screen support
- Added HPOS order edit-screen support
- Added responsive desktop and mobile layouts
- Added dynamic screen detection with
MutationObserver - Added permission and screen checks
- Added HPOS compatibility declaration
License
GPL-3.0
https://www.gnu.org/licenses/gpl-3.0.html
Author
Amirreza Shayesteh Far
- Website: https://amirrezaa.ir/
- GitHub: https://github.com/amirrezashf
- Repository: https://github.com/amirrezashf/WooCommerce-Order-Status-Buttons
دکمههای وضعیت سفارش ووکامرس
تبدیل انتخابگر پیشفرض وضعیت سفارش ووکامرس به مجموعهای از دکمههای جستجوپذیر، بدون ایجاد تغییر در فرایند اصلی ذخیره سفارش.
معرفی
ووکامرس بهصورت پیشفرض وضعیت سفارش را در صفحه ویرایش سفارش داخل یک فهرست کشویی نمایش میدهد. این روش برای فروشگاههایی که تعداد کمی وضعیت دارند مناسب است، اما زمانی که فروشگاه از وضعیتهای سفارشی متعددی استفاده کند، پیدا کردن و انتخاب وضعیت موردنظر دشوار و زمانبر میشود.
افزونه WooCommerce Order Status Buttons این فهرست کشویی را به یک مجموعه دکمه جستجوپذیر تبدیل میکند.
این افزونه منطق ذخیره سفارش در ووکامرس را تغییر نمیدهد. فیلد اصلی وضعیت سفارش همچنان داخل صفحه باقی میماند و با انتخاب هر دکمه، مقدار همان فیلد اصلی تغییر میکند. تغییر واقعی وضعیت فقط زمانی انجام میشود که مدیر سفارش را ذخیره یا بروزرسانی کند.
وضعیت فعلی ذخیرهشده سفارش نیز در یک باکس جداگانه نمایش داده میشود. انتخاب وضعیت جدید باعث تغییر این باکس نمیشود؛ زیرا این باکس فقط وضعیت ذخیرهشده فعلی را نمایش میدهد.
قابلیتها
- تبدیل فهرست کشویی وضعیت سفارش به دکمه
- جستجوی فوری میان وضعیتهای سفارش
- نمایش جداگانه وضعیت ذخیرهشده فعلی
- ثابت ماندن باکس وضعیت فعلی تا زمان ذخیره سفارش
- استفاده از فیلد اصلی وضعیت ووکامرس
- حفظ روند استاندارد ذخیره و بروزرسانی سفارش
- پشتیبانی از وضعیتهای پیشفرض و سفارشی
- پشتیبانی از ساختار قدیمی ذخیره سفارشها
- پشتیبانی از WooCommerce HPOS
- تشخیص صفحههای داینامیک مدیریت سفارش
- طراحی واکنشگرا برای دسکتاپ و موبایل
- بارگذاری فقط در صفحه ویرایش سفارش
- بدون ایجاد جدول اختصاصی دیتابیس
- بدون ذخیره تنظیمات یا metadata اضافی
- ساختار تکفایلی
- بدون نیاز به تنظیمات پس از فعالسازی
دلیل استفاده از این افزونه
برخی فروشگاهها برای مدیریت فرایند سفارش از وضعیتهای زیادی استفاده میکنند، مانند:
- در انتظار بررسی پرداخت
- در حال آمادهسازی
- در حال بستهبندی
- در حال پردازش انبار
- آماده ارسال
- تحویل به پیک
- در انتظار پاسخ مشتری
- در حال بررسی داخلی
- در حال بررسی بازپرداخت
- مراحل سفارشی پردازش سفارش
این افزونه وضعیتها را بهصورت دکمههای قابل مشاهده و جستجو نمایش میدهد، بدون اینکه رفتار اصلی ووکامرس را تغییر دهد.
نحوه عملکرد
هنگامی که مدیر صفحه ویرایش سفارش را باز میکند، افزونه:
- بررسی میکند که کاربر فعلی دسترسی مدیریت سفارشها را داشته باشد.
- تشخیص میدهد صفحه سفارش از ساختار کلاسیک یا HPOS استفاده میکند.
- فیلد اصلی وضعیت سفارش ووکامرس را پیدا میکند.
- تمام گزینههای موجود در فیلد وضعیت را میخواند.
- رابط ظاهری فهرست کشویی را مخفی میکند.
- بر اساس همان گزینهها دکمههای وضعیت را میسازد.
- وضعیت ذخیرهشده فعلی را در یک باکس جدا نمایش میدهد.
- با انتخاب دکمه، مقدار فیلد اصلی ووکامرس را تغییر میدهد.
- ذخیره واقعی سفارش را به ووکامرس واگذار میکند.
افزونه سفارش را بهصورت خودکار ذخیره نمیکند.
پس از انتخاب وضعیت، مدیر همچنان باید دکمه معمول بروزرسانی یا ذخیره سفارش را انتخاب کند.
رفتار باکس وضعیت فعلی
باکس بالای دکمهها وضعیتی را نمایش میدهد که هنگام بارگذاری صفحه در دیتابیس ذخیره شده است.
برای مثال، اگر وضعیت ذخیرهشده سفارش برابر باشد با:
در حال انجام
و مدیر وضعیت زیر را انتخاب کند:
تکمیل شده
دکمه «تکمیل شده» فعال میشود، اما باکس وضعیت فعلی همچنان «در حال انجام» را نشان میدهد.
پس از ذخیره سفارش و بارگذاری مجدد صفحه، باکس وضعیت فعلی به «تکمیل شده» تغییر میکند.
جستجو میان وضعیتها
فیلد جستجو، دکمههای وضعیت را بهصورت فوری فیلتر میکند.
برای مثال با وارد کردن:
بسته
ممکن است فقط وضعیتهای زیر نمایش داده شوند:
- در حال بستهبندی
- آماده بستهبندی
اگر هیچ موردی پیدا نشود، پیام مناسب نمایش داده میشود.
صفحههای مدیریت پشتیبانیشده
ساختار کلاسیک سفارشها
wp-admin/post.php?post=123&action=edit
ساختار HPOS
wp-admin/admin.php?page=wc-orders&action=edit&id=123
پشتیبانی از وضعیتهای سفارشی
افزونه فهرست ثابتی از وضعیتها داخل کد نگهداری نمیکند.
وضعیتها مستقیماً از فیلد اصلی وضعیت سفارش ووکامرس خوانده میشوند. به همین دلیل وضعیتهایی که توسط افزونههای سازگار یا کدهای سفارشی ثبت شدهاند، بهصورت خودکار نمایش داده میشوند.
روند ذخیره سفارش
افزونه از AJAX برای ذخیره وضعیت استفاده نمیکند و endpoint اختصاصی ایجاد نمیکند.
هنگام انتخاب یک دکمه:
- مقدار فیلد اصلی وضعیت ووکامرس تغییر میکند.
- event استاندارد
changeروی آن اجرا میشود. - افزونه منتظر میماند تا مدیر سفارش را ذخیره کند.
در نتیجه، ووکامرس همچنان مسئول موارد زیر است:
- بررسی سطح دسترسی
- اعتبارسنجی وضعیت
- ذخیره سفارش
- اجرای hookهای تغییر وضعیت
- رفتارهای مرتبط با موجودی
- ارسال ایمیلها
- اجرای integrationهای شخص ثالث
- افزودن یادداشتهای سیستمی مرتبط با وضعیت
طراحی واکنشگرا
دسکتاپ
- چیدمان دو ستونه دکمهها
- بخش قابل اسکرول
- فیلد جستجوی sticky
- نمایش واضح وضعیت انتخابشده
- باکس جداگانه وضعیت فعلی
موبایل
- چیدمان تکستونه
- باکس وضعیت فعلی تمامعرض
- دکمههای بزرگتر و مناسب لمس
- فاصلهگذاری بهینه
- عنوانهای وسطچین
عملکرد و بهینهسازی
فایلهای CSS و JavaScript افزونه فقط در صفحه ویرایش سفارش و برای کاربران مجاز بارگذاری میشوند.
افزونه در این بخشها بارگذاری نمیشود:
- پیشخوان وردپرس
- ویرایش محصولات
- نوشتهها و برگهها
- تنظیمات ووکامرس
- گزارشها
- صفحات frontend
- سبد خرید
- تسویه حساب
- حساب کاربری
- صفحه تشکر از خرید
امنیت
افزونه:
- از اجرای مستقیم فایل PHP جلوگیری میکند
- سطح دسترسی مدیریت سفارش را بررسی میکند
- پارامترهای URL را پاکسازی میکند
- صفحه ویرایش سفارش را اعتبارسنجی میکند
- تنظیمات JavaScript را با
wp_json_encode()منتقل میکند - AJAX عمومی ایجاد نمیکند
- REST API اختصاصی ایجاد نمیکند
- مستقیماً در دیتابیس نمینویسد
- اعتبارسنجی ووکامرس را دور نمیزند
- سفارش را بدون اقدام مدیر ذخیره نمیکند
- اطلاعات سفارش را در frontend نمایش نمیدهد
ذخیرهسازی داده
این افزونه هیچ داده اختصاصی ذخیره نمیکند.
افزونه موارد زیر را ایجاد نمیکند:
- جدول دیتابیس
- گزینه وردپرس
- transient
- user meta
- order meta
- تسک زمانبندیشده
- فایل log
تمام تغییرات وضعیت از طریق فرایند استاندارد ذخیره سفارش ووکامرس انجام میشوند.
سازگاری با HPOS
افزونه با روش رسمی ووکامرس، سازگاری خود را با High-Performance Order Storage اعلام میکند و هیچ دسترسی مستقیمی به جدولهای سفارش ندارد.
پیشنیازها
- PHP 7.4 یا جدیدتر
- WordPress 6.0 یا جدیدتر
- WooCommerce
- حساب کاربری دارای دسترسی ویرایش سفارشها
نصب
- فایل ZIP افزونه را دانلود کنید.
- وارد افزونهها ← افزودن افزونه تازه شوید.
- گزینه بارگذاری افزونه را انتخاب کنید.
- فایل ZIP را بارگذاری کنید.
- افزونه را نصب و فعال کنید.
- یک سفارش ووکامرس را باز کنید.
نصب دستی
- فایل ZIP را استخراج کنید.
- پوشه افزونه را در مسیر زیر قرار دهید:
wp-content/plugins/
- افزونه را از بخش افزونههای وردپرس فعال کنید.
ساختار فایلها
WooCommerce-Order-Status-Buttons/
├── woocommerce-order-status-buttons.php
├── README.md
└── LICENSE
نحوه استفاده
- وارد ووکامرس ← سفارشها شوید.
- یک سفارش را باز کنید.
- وضعیت موردنظر را جستجو کنید.
- دکمه وضعیت را انتخاب کنید.
- سفارش را ذخیره یا بروزرسانی کنید.
عیبیابی
دکمهها نمایش داده نمیشوند
موارد زیر را بررسی کنید:
- ووکامرس فعال باشد.
- سفارش موجودی را ویرایش کنید.
- حساب شما دسترسی مدیریت سفارشها را داشته باشد.
- فیلد اصلی وضعیت ووکامرس حذف نشده باشد.
- JavaScript مرورگر فعال باشد.
- خطای JavaScript در صفحه وجود نداشته باشد.
وضعیت انتخابشده ذخیره نمیشود
انتخاب دکمه باعث ذخیره خودکار سفارش نمیشود. پس از انتخاب وضعیت، سفارش را ذخیره یا بروزرسانی کنید.
باکس وضعیت فعلی تغییر نمیکند
این رفتار عمدی است. باکس فقط وضعیت ذخیرهشده را نشان میدهد و پس از ذخیره و بارگذاری مجدد تغییر میکند.
یک وضعیت سفارشی نمایش داده نمیشود
بررسی کنید آن وضعیت در انتخابگر اصلی ووکامرس وجود داشته باشد.
فهرست اصلی برای لحظهای دیده میشود
در برخی صفحههای HPOS ممکن است رابط اصلی پیش از اجرای کامل اسکریپت برای مدت کوتاهی دیده شود. افزونه از MutationObserver برای کاهش این حالت استفاده میکند.
نکات سازگاری
ممکن است سازگاری محدود شود اگر افزونه دیگری:
- فیلد اصلی وضعیت را حذف کند
- رابط وضعیت را کاملاً جایگزین کند
- وضعیت را با workflow اختصاصی ذخیره کند
- event استاندارد فیلد را متوقف کند
- ساختار HTML صفحه سفارش را بهشدت تغییر دهد
دسترسپذیری
رابط افزونه شامل:
- دکمههای استاندارد HTML
- امکان فوکوس با کیبورد
- حالت فوکوس قابل مشاهده
- فیلد جستجو
- کنتراست مناسب
- چیدمان واکنشگرا
- نمایش واضح وضعیت فعلی
پشتیبانی مرورگر
افزونه از فناوریهای زیر استفاده میکند:
- jQuery داخلی وردپرس
MutationObserver- DOM API استاندارد
- CSS Grid
- Media Query
هوکها و فیلترها
نسخه 1.0.0 هوک یا فیلتر عمومی اختصاصی اضافه نمیکند.
هوکهای عادی ووکامرس پس از ذخیره سفارش همچنان اجرا میشوند، از جمله:
woocommerce_order_status_changed
woocommerce_order_status_{$from}_to_{$to}
woocommerce_order_status_{$to}
حریم خصوصی
افزونه هیچ اطلاعات شخصی جمعآوری یا ارسال نمیکند.
این افزونه:
- درخواست خارجی ندارد
- analytics ندارد
- tracking اضافه نمیکند
- فعالیت مدیران را ذخیره نمیکند
- اطلاعات مشتری را ذخیره نمیکند
- به سرویس شخص ثالث متصل نمیشود
تاریخچه تغییرات
1.0.0
- انتشار اولیه
- افزودن دکمههای جستجوپذیر وضعیت سفارش
- افزودن باکس جداگانه وضعیت فعلی
- حفظ روند اصلی ذخیره ووکامرس
- پشتیبانی از وضعیتهای پیشفرض و سفارشی
- پشتیبانی از صفحه کلاسیک سفارش
- پشتیبانی از HPOS
- طراحی واکنشگرا
- تشخیص رابط داینامیک با
MutationObserver - بررسی دسترسی و صفحه مدیریت
- اعلام سازگاری با HPOS
مجوز
GPL-3.0
https://www.gnu.org/licenses/gpl-3.0.html
نویسنده
Amirreza Shayesteh Far
- وبسایت: https://amirrezaa.ir/
- گیتهاب: https://github.com/amirrezashf
- مخزن افزونه: https://github.com/amirrezashf/WooCommerce-Order-Status-Buttons