{"id":74973,"date":"2017-09-20T07:47:53","date_gmt":"2017-09-20T07:47:53","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/purchase-orders-for-woocommerce\/"},"modified":"2025-11-11T23:15:25","modified_gmt":"2025-11-11T23:15:25","slug":"purchase-orders-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/ory.wordpress.org\/plugins\/purchase-orders-for-woocommerce\/","author":13372297,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.12.2","stable_tag":"1.12.2","tested":"6.8.5","requires":"4.8","requires_php":"7.4","requires_plugins":null,"header_name":"Purchase Orders for WooCommerce","header_author":"McGregor Media Web Design","header_description":"Adds a Purchase Order payment method to WooCommerce.","assets_banners_color":"fffffe","last_updated":"2025-11-11 23:15:25","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/paypal.me\/mcgregormedia","header_plugin_uri":"https:\/\/mcgregormedia.co.uk","header_author_uri":"https:\/\/mcgregormedia.co.uk","rating":4.2,"author_block_rating":0,"active_installs":1000,"downloads":30016,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"mcgregormedia","date":"2017-09-20 07:47:28"},"1.1.0":{"tag":"1.1.0","author":"mcgregormedia","date":"2017-10-12 10:59:01"},"1.1.1":{"tag":"1.1.1","author":"mcgregormedia","date":"2018-02-08 10:17:32"},"1.10.0":{"tag":"1.10.0","author":"mcgregormedia","date":"2024-05-19 14:41:01"},"1.10.1":{"tag":"1.10.1","author":"mcgregormedia","date":"2024-05-23 19:43:01"},"1.11.0":{"tag":"1.11.0","author":"mcgregormedia","date":"2024-09-27 20:46:27"},"1.11.1":{"tag":"1.11.1","author":"mcgregormedia","date":"2024-09-27 21:03:32"},"1.12.0":{"tag":"1.12.0","author":"mcgregormedia","date":"2025-11-08 16:13:44"},"1.12.1":{"tag":"1.12.1","author":"mcgregormedia","date":"2025-11-10 23:11:10"},"1.12.2":{"tag":"1.12.2","author":"mcgregormedia","date":"2025-11-11 23:15:25"},"1.2.0":{"tag":"1.2.0","author":"mcgregormedia","date":"2018-04-27 10:54:58"},"1.3.0":{"tag":"1.3.0","author":"mcgregormedia","date":"2018-05-17 08:15:23"},"1.4.0":{"tag":"1.4.0","author":"mcgregormedia","date":"2018-05-18 17:17:42"},"1.5.0":{"tag":"1.5.0","author":"mcgregormedia","date":"2019-02-15 10:47:15"},"1.6.0":{"tag":"1.6.0","author":"mcgregormedia","date":"2019-05-01 10:31:54"},"1.7.0":{"tag":"1.7.0","author":"mcgregormedia","date":"2019-06-10 12:20:00"},"1.7.1":{"tag":"1.7.1","author":"mcgregormedia","date":"2019-06-11 15:27:06"},"1.7.10":{"tag":"1.7.10","author":"mcgregormedia","date":"2020-08-08 09:28:43"},"1.7.11":{"tag":"1.7.11","author":"mcgregormedia","date":"2020-10-15 09:29:12"},"1.7.12":{"tag":"1.7.12","author":"mcgregormedia","date":"2020-11-11 14:21:49"},"1.7.13":{"tag":"1.7.13","author":"mcgregormedia","date":"2020-11-24 12:24:16"},"1.7.14":{"tag":"1.7.14","author":"mcgregormedia","date":"2020-12-14 11:50:04"},"1.7.15":{"tag":"1.7.15","author":"mcgregormedia","date":"2020-12-14 14:40:35"},"1.7.16":{"tag":"1.7.16","author":"mcgregormedia","date":"2021-03-08 17:55:13"},"1.7.4":{"tag":"1.7.4","author":"mcgregormedia","date":"2019-08-13 12:27:19"},"1.7.5":{"tag":"1.7.5","author":"mcgregormedia","date":"2019-10-24 11:18:15"},"1.7.6":{"tag":"1.7.6","author":"mcgregormedia","date":"2020-01-24 11:36:27"},"1.7.7":{"tag":"1.7.7","author":"mcgregormedia","date":"2020-02-26 10:18:42"},"1.7.8":{"tag":"1.7.8","author":"mcgregormedia","date":"2020-06-03 14:05:17"},"1.7.9":{"tag":"1.7.9","author":"mcgregormedia","date":"2020-07-13 09:59:50"},"1.8":{"tag":"1.8","author":"mcgregormedia","date":"2021-06-30 11:44:28"},"1.8.1":{"tag":"1.8.1","author":"mcgregormedia","date":"2022-10-27 16:55:50"},"1.8.2":{"tag":"1.8.2","author":"mcgregormedia","date":"2022-10-27 16:55:50"},"1.8.3":{"tag":"1.8.3","author":"mcgregormedia","date":"2023-03-20 08:37:43"},"1.8.4":{"tag":"1.8.4","author":"mcgregormedia","date":"2023-08-28 09:45:10"},"1.8.5":{"tag":"1.8.5","author":"mcgregormedia","date":"2023-09-06 09:38:41"},"1.9.1":{"tag":"1.9.1","author":"mcgregormedia","date":"2023-12-20 10:28:30"}},"upgrade_notice":[],"ratings":{"1":1,"2":0,"3":0,"4":0,"5":4},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":1732708,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":1732708,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":1732708,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":1732708,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.1.1","1.10.0","1.10.1","1.11.0","1.11.1","1.12.0","1.12.1","1.12.2","1.2.0","1.3.0","1.4.0","1.5.0","1.6.0","1.7.0","1.7.1","1.7.10","1.7.11","1.7.12","1.7.13","1.7.14","1.7.15","1.7.16","1.7.4","1.7.5","1.7.6","1.7.7","1.7.8","1.7.9","1.8","1.8.1","1.8.2","1.8.3","1.8.4","1.8.5","1.9.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1732708,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":1732708,"resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"The admin settings for the gateway.","2":"Checkout page on Storefront theme."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[6593,146690,286],"plugin_category":[],"plugin_contributors":[94237],"plugin_business_model":[],"class_list":["post-74973","plugin","type-plugin","status-publish","hentry","plugin_tags-payment-gateway","plugin_tags-purchase-order","plugin_tags-woocommerce","plugin_contributors-mcgregormedia","plugin_committers-mcgregormedia"],"banners":{"banner":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/banner-772x250.jpg?rev=1732708","banner_2x":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/banner-1544x500.jpg?rev=1732708","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/icon-128x128.jpg?rev=1732708","icon_2x":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/icon-256x256.jpg?rev=1732708","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/screenshot-1.png?rev=1732708","caption":"The admin settings for the gateway."},{"src":"https:\/\/ps.w.org\/purchase-orders-for-woocommerce\/assets\/screenshot-2.png?rev=1732708","caption":"Checkout page on Storefront theme."}],"raw_content":"<!--section=description-->\n<p>Adds a Purchase Order payment method to WooCommerce.<\/p>\n\n<p>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!<\/p>\n\n<p>The purchase order details will be displayed in the admin order screen, the customer order received screen and both admin and customer order emails.<\/p>\n\n<h4>WooCommerce compatibility<\/h4>\n\n<p>This plugin is compatible with WooCommerce 3.x, 4.x, 5.x, 6.x, 7.x, 8.x, 9.x and 10.x versions.<\/p>\n\n<h4>HPOS compatibility<\/h4>\n\n<p>This plugin is compatible with WooCommerce High Performance Order Storage (HPOS) and WordPress posts storage (legacy).<\/p>\n\n<h4>Checkout Blocks Compatibility<\/h4>\n\n<p>This plugin is not yet compatible with checkout blocks.<\/p>\n\n<h4>Compatibility with other plugins<\/h4>\n\n<p>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:<\/p>\n\n<p>_purchase_order_number\n_purchase_order_company_name\n_purchase_order_address1\n_purchase_order_address2\n_purchase_order_address3\n_purchase_order_town\n_purchase_order_county\n_purchase_order_postcode\n_purchase_order_email<\/p>\n\n<h4>Order status<\/h4>\n\n<p>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.<\/p>\n\n<h4>Custom fields<\/h4>\n\n<p>You can add your own fields to the frontend checkout form by adding custom HTML to the action hook in the PO checkout form:<\/p>\n\n<p>pofwc_form_after_po_form<\/p>\n\n<p>To add a text input field after the PO number field, the code should look something like this:<\/p>\n\n<p>function custom_checkout_field_after_po_form() {<\/p>\n\n<pre><code>echo '&lt;p class=\"form-row form-row-wide\"&gt;';\n    echo '&lt;label for=\"YOUR-FIELD-ID\"&gt;YOUR FIELD LABEL TEXT&lt;\/label&gt;';\n    echo '&lt;input type=\"text\" id=\"YOUR-FIELD-ID\" name=\"YOUR_FIELD_NAME\" class=\"input-text\" placeholder=\"YOUR FIELD PLACEHOLDER\"&gt;';\necho '&lt;\/p&gt;';\n<\/code><\/pre>\n\n<p>}\nadd_action( 'pofwc_form_after_po_form', 'custom_checkout_field_after_po_form' );<\/p>\n\n<p>You can of course change the form HTML to output a different field type such as a <code>select<\/code> dropdown or <code>textarea<\/code>.<\/p>\n\n<p>To save your custom field, hook into the woocommerce_checkout_update_order_meta action as in the example below:<\/p>\n\n<p>function custom_checkout_field_update_order_meta( $order_id ) {<\/p>\n\n<pre><code>$order = wc_get_order( $order_id );\n\nif ( ! empty( $_POST['YOUR_FIELD_NAME'] ) ) {\n    $order-&gt;update_meta_data( 'YOUR_FIELD_NAME', sanitize_text_field( $_POST['YOUR_FIELD_NAME'] ) );\n}\n\n$order-&gt;save();\n<\/code><\/pre>\n\n<p>}\nadd_action( 'woocommerce_checkout_update_order_meta', 'custom_checkout_field_update_order_meta', 10, 1 );<\/p>\n\n<p>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:<\/p>\n\n<p>pofwc_thankyou_display_after_po_form\npofwc_email_display_after_po_form\npofwc_account_display_after_po_form\npofwc_admin_display_after_po_form<\/p>\n\n<p>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:<\/p>\n\n<p>function display_custom_order_data_after_po_form( $order ) {<\/p>\n\n<pre><code>echo ( $order-&gt;get_meta( 'YOUR_FIELD_NAME', true ) ) ? esc_html( $order-&gt;get_meta( 'YOUR_FIELD_NAME', true ) ) . '&lt;br&gt;' : '';\n<\/code><\/pre>\n\n<p>}\nadd_action( 'pofwc_thankyou_display_after_po_form', 'display_custom_order_data_after_po_form', 10, 1 );\nadd_action( 'pofwc_account_display_after_po_form', 'display_custom_order_data_after_po_form', 10, 1 );\nadd_action( 'pofwc_admin_display_after_po_form', 'display_custom_order_data_after_po_form', 10, 1 );<\/p>\n\n<p>Displaying the data in the emails is slightly different as data escaping is done later in the output process:<\/p>\n\n<p>function display_email_custom_order_data_after_po_form( $order ) {<\/p>\n\n<pre><code>echo $order-&gt;get_meta( 'YOUR_FIELD_NAME', true ) ? $order-&gt;get_meta( 'YOUR_FIELD_NAME', true ) : '';\n<\/code><\/pre>\n\n<p>}\nadd_action( 'pofwc_email_display_after_po_form', 'display_email_custom_order_data_after_po_form', 10, 1 );<\/p>\n\n<p>This code all goes in your functions.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.<\/p>\n\n<h4>GDPR information<\/h4>\n\n<p>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).<\/p>\n\n<h4>Roadmap<\/h4>\n\n<p>The ability to add and edit purchase order data in the Add\/Edit Order screen was introduced in version 1.12.0 but due to it causing fatal errors on some users' sites, it was removed in version 1.12.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.<\/p>\n\n<!--section=installation-->\n<p>Install as usual by going to Plugins &gt; Add New and searching for Purchase Orders for WooCommerce or download the plugin file and upload to your-site.com\/wp-content\/plugins.<\/p>\n\n<!--section=changelog-->\n<p>1.12.2 11-11-2025\nREMOVED: Add\/edit PO data in the Add Order\/Edit Order screens due to fatal errors<\/p>\n\n<p>1.12.1 10-11-2025\nADDED: Conditional so PO data is only displayed\/editable if order payment method is PO\nADDED: Conditional to $order-&gt;update_meta_data is only called if order payment method is PO<\/p>\n\n<p>1.12.0 08-11-2025\nADDED: Add\/edit PO data in the Add Order\/Edit Order screens\nUPDATED: Compatibility with WordPress 6.8\nUPDATED: Compatibility with WooCommerce 10.3<\/p>\n\n<p>1.11.1 27-09-2024\nTWEAK: Format readme code text<\/p>\n\n<p>1.11.0 27-09-2024\nADDED: Action hooks in PO checkout form, thank you page, order history and admin Edit Order screen\nUPDATED: Compatibility with WooCommerce 9.3<\/p>\n\n<p>1.10.1 23-05-2024\nFIXED: PHP notice \"Function is_internal_meta_key was called incorrectly\"\nFIXED: Deprecated dynamic properties for PHP 8.2\nFIXED: Errors in fr-CA translation\nCHECKED: Reported issues with order emails not sending. Could not replicate issue.<\/p>\n\n<p>1.10.0 19-05-2024\nFIXED: Missing translation strings\nADDED: French Canadian translation (H\/T Marc-Andr\u00e9)\nADDED: Plugin dependencies\nUPDATED: Compatibility with WooCommerce 8.9\nREMOVED: Notice displayed if WooCommerce is not activated\nREMOVED: Legacy meta data functions so WooCommerce now handles compatibility<\/p>\n\n<p>1.9.1 20-12-2023\nUPDATED: compatibility with WooCommerce 8.4<\/p>\n\n<p>1.9.0 15-11-2023\nADDED: HPOS compatibility\nUPDATED: Tested up to WordPress 6.5\nUPDATED: compatibility with WooCommerce 8.3\nUPDATED: minimum PHP version to 7.4<\/p>\n\n<p>1.8.5 06-09-2023\nADDED: ability to select from all order statuses, including custom statuses\nUPDATED: compatibility with WooCommerce 8.1<\/p>\n\n<p>1.8.4 28-08-2023\nADDED: option to not display PO details in order emails\nUPDATED: Tested up to WordPress 6.3\nUPDATED: compatibility with WooCommerce 8.0<\/p>\n\n<p>1.8.3 14-03-2023\nUPDATED: Tested up to WordPress 6.2\nUPDATED: compatibility with WooCommerce 7.5<\/p>\n\n<p>1.8.2 27-10-2022\nUPDATED: Tested up to WordPress 6.1\nUPDATED: compatibility with WooCommerce 7.1<\/p>\n\n<p>1.8.1 25-10-2021\nADDED: Added wp_kses_post() to email output\nUPDATED: compatibility with WooCommerce 5.8<\/p>\n\n<p>1.8 30-06-2021\nADDED: Order pending status\nUPDATED: Tested up to WordPress 5.8\nUPDATED: compatibility with WooCommerce 5.5\nUPDATED: ReadMe<\/p>\n\n<p>1.7.16 08-03-2021\nFIXED: Company name translation not working on the frontend\nUPDATED: Tested up to WordPress 5.7\nUPDATED: compatibility with WooCommerce 5.1<\/p>\n\n<p>1.7.15 14-12-2020\nFIXED: Issue with customer not being able to checkout if PO number is empty but is not required\nUPDATED: English (UK) translation files\nTWEAK: Replaced POT file<\/p>\n\n<p>1.7.14 14-12-2020\nADDED: English (Canada) translation<\/p>\n\n<p>1.7.13 24-11-2020\nUPDATED: Tested up to WordPress 5.6<\/p>\n\n<p>1.7.12 11-11-2020\nUPDATED: compatibility with WooCommerce 4.7<\/p>\n\n<p>1.7.11 15-10-2020\nUPDATED: compatibility with WooCommerce 4.6.x<\/p>\n\n<p>1.7.10 08-08-2020\nADDED: required option for purchase order number field\nUPDATED: Tested up to WordPress 5.5\nUPDATED: Tested up to WooCommerce 4.4<\/p>\n\n<p>1.7.9 13-07-2020\nUPDATED: Tested up to WooCommerce 4.3\nADDED: Purchase order details now displayed on order-received page\nADDED: Purchase order details now displayed on order emails<\/p>\n\n<p>1.7.8 03-06-2020\nUPDATED: Tested up to WooCommerce 4.2<\/p>\n\n<p>1.7.7 26-02-2020\nUPDATED: Tested up to WooCommerce 4.0\nUPDATED: Tested up to WordPress 5.4<\/p>\n\n<p>1.7.6 24-01-2020\nUPDATED: Tested up to WooCommerce 3.9<\/p>\n\n<p>1.7.5 24-10-2019\nUPDATED: Tested up to WordPress 5.3\nTWEAK: Removed erroneous colon in pofwc_email_order_meta_fields()<\/p>\n\n<p>1.7.4 13-08-2019\nUPDATED: Tested up to WooCommerce 3.7\nADDED: Purchase order number now displayed on order-received page\nADDED: Purchase order number now added to order emails\nTWEAK: Changed order of functionality in process_payment() to ensure order meta is available when order emails are sent<\/p>\n\n<p>1.7.1 11-06-2019\nFIXED: Fatal error on some systems from incomplete php tag.<\/p>\n\n<p>1.7.0 10-06-2019\nADDED: Option to display\/hide\/require any of the purchase order checkout fields except PO number which is always displayed and required.\nUPDATED: new options listed in readme \nUPDATED: en_GB translation<\/p>\n\n<p>1.6.0 01-05-2019\nADDED: Compatibility with WooCommerce 3.6+ and WordPress 5.2+<\/p>\n\n<p>1.5.0 15-02-2019\nADDED: Compatibility with WooCommerce 3.5+ and WordPress 5.1+<\/p>\n\n<p>1.4.0 18-05-2018\nFIXED: Notice that payment_method was called incorrectly\nADDED: Gateway description on checkout page\nADDED: Invoice email field\nADDED: various field settings\nADDED: en_GB translation, plugin now defaults to en_US\nUPDATED: GDPR notice in readme to reflect the new email setting\nREMOVED: 'Where should we send the invoice to?' text from checkout page as not really required<\/p>\n\n<p>1.3.0 17-05-2018\nADDED: Compatibility with WooCommerce 3.4+ and WordPress 5.0+<\/p>\n\n<p>1.2.0 27-04-2018\nFIXED: Stripe plugin validation conflict\nADDED: check if WooCommerce is installed upon activation\nADDED: GDPR notice in ReadMe\nREMOVED: Stripe plugin conflict warning<\/p>\n\n<p>1.1.1 08-02-2018\nADDED: Stripe plugin conflict warning\nUPDATED: WC requires at least and WC tested up to tags for WooCommerce 3.3.x<\/p>\n\n<p>1.1.0 12-10-2017\nADDED: WC requires at least and WC tested up to tags for WooCommerce 3.2+\nUPDATED: bumped WP tested up to tag<\/p>\n\n<p>1.0.0 19-09-2017\nInitial release<\/p>","raw_excerpt":"Adds a Purchase Order payment method to WooCommerce.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/74973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=74973"}],"author":[{"embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mcgregormedia"}],"wp:attachment":[{"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=74973"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=74973"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=74973"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=74973"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=74973"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ory.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=74973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}