About this plugin
OrderCraft for WooCommerce is a lightweight developer utility designed to streamline local development, agency QA workflows, transactional email design verification, and staging site testing.
Instead of filling out front-end checkout forms repeatedly, this plugin adds a dedicated quick-action button ( ⚡ + Test Order ) to your top WordPress Admin Bar. With a single click, it programmatically generates a complete mock order using native WooCommerce CRUD APIs and redirects you straight to the WooCommerce order edit screen.
Key Features
- Instant Admin Bar Action: Create a test order in seconds from anywhere in the WP Admin dashboard.
- Multi-Item Selection: Randomly picks between 2 and 4 published products with varied quantities (1–3 items per product).
- Smart Coupon Engine: Applies an existing active store coupon or creates a temporary percentage discount coupon ( TEST10OFF – TEST25OFF ) on the fly if no coupons exist.
- Randomized Shipping Rates: Attaches realistic shipping line items (Standard Flat Rate, Express Delivery, Overnight Air, or Free Shipping Promo) with computed totals.
- Accurate Totals Calculation: Triggers calculate_totals() to accurately factor line items, shipping fees, tax rates, and discount reductions into the final order amount.
- Zero Front-End Friction: Bypasses cart pages, checkout forms, and real payment gateways by defaulting to Cash on Delivery (Test).
- Developer Focused: Built with clean, lightweight PHP using native WooCommerce CRUD classes ( wc_create_order(), WC_Order_Item_Shipping, WC_Coupon ). Requires zero external assets or background processes.
How It Works
When you click the ⚡ + Test Order button in the Admin Bar:
- Security & Permission Check: The plugin verifies user capabilities ( manage_woocommerce ) and validates the request nonce ( check_admin_referer ).
- Product Retrieval: Queries the database using wc_get_products() for 2 to 4 published products.
- Order Instantiation: Initializes a new order object via wc_create_order().
- Line Item & Quantity Assignment: Adds selected products with randomized quantities between 1 and 3.
- Customer Details: Populates standard test billing and shipping addresses.
- Shipping Selection: Instantiates a WC_Order_Item_Shipping object and attaches a randomly selected shipping rate.
- Coupon Application: Fetches an active coupon via get_posts('shop_coupon') or generates a fallback percentage coupon using WC_Coupon.
- Recalculation & Status: Runs $order->calculate_totals(), sets the status to processing, and redirects directly to the edit order screen.
License & Copyright
0 or later (GPLv2+).
- License: GPLv2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
- Copyright: © 2026 Roshan Dalvi, Walstar Technologies, Pratap Vashi, Walstar Media.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.