Test Orders for WooCommerce®
Test Orders for WooCommerce®
Test Orders for WooCommerce® is a lightweight plugin that adds a "Test Order" option to your WooCommerce store, allowing you to place test orders without requiring payment.
Perfect for staging environments or testing new WooCommerce setups.
Features
- Test Order Payment Gateway: Adds a "Test Order" option to your checkout.
- Customizable Settings: Configure the order status and whether to reduce stock levels for test orders.
- Seamless WooCommerce Integration: Built using WooCommerce hooks and standards.
- Developer-Friendly: Easily extensible for advanced use cases.
- Localization Ready: Fully translatable with
.mo
/.po
files.
Installation
From the WordPress Admin Dashboard:
- Download the latest release from GitHub.
- Go to Plugins > Add New > Upload Plugin.
- Upload the downloaded ZIP file and activate the plugin.
- Ensure WooCommerce® is active.
Manual Installation:
- Upload the
test-orders-for-woocommerce
folder to the/wp-content/plugins/
directory. - Activate the plugin through the Plugins menu in WordPress.
- Ensure WooCommerce® is active.
Usage
Enabling Test Orders
- Go to WooCommerce > Settings > Payments.
- Enable the "Test Order" payment gateway.
Customizing Test Order Behavior
- Navigate to WooCommerce > Test Orders.
- Configure the following options:
- Order Status: Choose the default status for test orders (
Completed
,Processing
,On Hold
, orPending
). - Reduce Stock: Determine whether stock levels should decrease when processing test orders.
- Order Status: Choose the default status for test orders (
Example Use Case
Use the "Test Order" gateway in staging environments to verify order workflows, email notifications, and other post-purchase functionalities without actual payments.
Development
Prerequisites
- WordPress® Version: 5.0 or higher
- WooCommerce® Version: 4.0 or higher
Code Structure
- Custom Payment Gateway: Implements WooCommerce's
WC_Payment_Gateway
class. - Admin Settings Page: Accessible via WooCommerce > Test Orders.
Extending the Plugin
Developers can customize plugin behavior by using filters and actions. For example, modify the default test order status:
add_filter( 'wc_test_order_status', function( $status ) {
return 'on-hold';
});
Updating the Plugin
This plugin uses YahnisElsts/Plugin Update Checker for automatic updates via GitHub.
Security
- Input Sanitization: All user inputs are sanitized using WordPress functions.
- Nonce Protection: Nonces are used for all settings forms to prevent CSRF attacks.
- Escaping Outputs: Proper escaping is applied to all outputs in the admin panel.
-
- *
No releases yet.
No issues yet.
Hash Verification
ZIP files downloaded via this site have an associated SHA256 hash.
Mac
On Mac, you can use the sha256 command to calculate the hash of a downloaded ZIP file. Open terminal and execute:
sha256 [filename]
Where [filename] is the name of the ZIP file. If the hash matches the one on the website, the ZIP file is genuine.
Linux
On Linux, you can use the sha256sum command to calculate the hash of a downloaded ZIP file. From a shell, execute:
sha256sum [filename]
Where [filename] is the name of the ZIP file. If the hash matches the one on the website, the ZIP file is genuine.
Github Repository
This project is located on Github in the repository robertdevore/test-orders-for-woocommerce.
Star Support Project