WordPress plugin intelligence profile

Purchase Orders for WooCommerce

Adds a Purchase Order payment method to WooCommerce.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.8
Current version1.12.2
WordPress coverageTested up to WordPress 6.8
Minimum stackWP 4.8 · PHP 7.4
Directory statusactive
Last directory update11 Nov 202511mo ago
Active installations1K+Adoption metric — not a quality score
WordPress.org rating4.2 / 5 from 5 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Purchase Orders for WooCommerce version 1.12.2 as active, updated 11mo ago and tested up to WordPress 6.8.

Overview

About this plugin

Adds a Purchase Order payment method to WooCommerce.

Select if the order is to be Pending, On Hold or Processing after checkout. The gateway will ask for the purchase order number – select whether to also display text boxes for name and address of the company to be invoiced, and whether any of those are required fields. Don’t forget to mark a field as not required if it’s not to be displayed or your customer will not be able to check out!

The purchase order details will be displayed in the admin order screen, the customer order received screen and both admin and customer order emails.

WooCommerce compatibility

x versions.

HPOS compatibility

This plugin is compatible with WooCommerce High Performance Order Storage (HPOS) and WordPress posts storage (legacy).

Checkout Blocks Compatibility

This plugin is not yet compatible with checkout blocks.

Compatibility with other plugins

Some invoicing plugins require the meta keys of purchase order data to display this data on invoices. The meta keys used in this plugin are listed below:

_purchase_order_number

_purchase_order_company_name

_purchase_order_address1

_purchase_order_address2

_purchase_order_address3

_purchase_order_town

_purchase_order_county

_purchase_order_postcode

_purchase_order_email

Order status

Select the order status to apply to the order to when a customer checks out using a Purchase Order. All order statuses are available for selection including any custom statuses that may have been added. Be aware that if you set the status to Pending, neither you nor the customer will receive an order email after checkout – this is standard WooCommerce functionality.

By default, order emails will be sent when a status is changed from Pending to On Hold or Processing.

Custom fields

You can add your own fields to the frontend checkout form by adding custom HTML to the action hook in the PO checkout form:

pofwc_form_after_po_form

To add a text input field after the PO number field, the code should look something like this:

function custom_checkout_field_after_po_form() {

echo '<p class="form-row form-row-wide">'; echo '<label for="YOUR-FIELD-ID">YOUR FIELD LABEL TEXT</label>'; echo '<input type="text" id="YOUR-FIELD-ID" name="YOUR_FIELD_NAME" class="input-text" placeholder="YOUR FIELD PLACEHOLDER">'; echo '</p>';

}

add_action( ‘pofwc_form_after_po_form’, ‘custom_checkout_field_after_po_form’ );

You can of course change the form HTML to output a different field type such as a select dropdown or textarea.

To save your custom field, hook into the woocommerce_checkout_update_order_meta action as in the example below:

function custom_checkout_field_update_order_meta( $order_id ) {

$order = wc_get_order( $order_id );

if (! empty( $_POST['YOUR_FIELD_NAME'] ) ) { $order->update_meta_data( 'YOUR_FIELD_NAME', sanitize_text_field( $_POST['YOUR_FIELD_NAME'] ) ); }

$order->save();

}

add_action( ‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_field_update_order_meta’, 10, 1 );

There are four places the PO data can be displayed: the order thank you page, the order emails, the customer order history, and the admin Edit Order screen. To display your custom field data, use one of the following action hooks to add your data in the required place:

pofwc_thankyou_display_after_po_form

pofwc_email_display_after_po_form

pofwc_account_display_after_po_form

pofwc_admin_display_after_po_form

To output your example text input from above in the checkout thank you page, the Edit Order screen and customer order history, the code should look something like this:

function display_custom_order_data_after_po_form( $order ) {

echo ( $order->get_meta( 'YOUR_FIELD_NAME', true ) )? esc_html( $order->get_meta( 'YOUR_FIELD_NAME', true ) ). '<br>': '';

}

add_action( ‘pofwc_thankyou_display_after_po_form’, ‘display_custom_order_data_after_po_form’, 10, 1 );

add_action( ‘pofwc_account_display_after_po_form’, ‘display_custom_order_data_after_po_form’, 10, 1 );

add_action( ‘pofwc_admin_display_after_po_form’, ‘display_custom_order_data_after_po_form’, 10, 1 );

Displaying the data in the emails is slightly different as data escaping is done later in the output process:

function display_email_custom_order_data_after_po_form( $order ) {

echo $order->get_meta( 'YOUR_FIELD_NAME', true )? $order->get_meta( 'YOUR_FIELD_NAME', true ): '';

}

add_action( ‘pofwc_email_display_after_po_form’, ‘display_email_custom_order_data_after_po_form’, 10, 1 );

php file in your child theme – don’t place this code in a parent theme (unless it’s one you maintain yourself) as it will be overwritten when the theme is updated.

GDPR information

This plugin will gather and store a company’s name, address and/or email address. This could also be construed as an individual’s personal data. However, as the user has opted to pay by this method, it is suggested that the lawful basis for processing this data is contractual necessity.

Processing is necessary in order to send the invoice to the user or user’s representative. This data is stored as standard postmeta data and will be retained until the order is permanently deleted (not trashed).

Roadmap

2. It is still in the roadmap to add, as is compatibility with the Gutemnberg checkout block. No timeline exists for this as yet however.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • payment gateway
  • purchase order
  • woocommerce
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.8

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.8.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.8
Minimum requirementsWordPress 4.8 · PHP 7.4
Update activity11 Nov 202511mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.