less than a minute read • Updated 8 days ago
Purchase Orders
Allow customers to checkout without payment via Foxy's purchase order payment method.
- Features
- Multi-Currency
About Purchase Orders with FoxyCart
To enable Purchase Orders as a payment method simply check the box on your “payments” page in your FoxyCart admin.
Using the “Purchase Order” payment method allows you to have a required (but otherwise “open” input, in that there is no additional validation) field on your checkout. This can be used for customers to enter Purchase Order #s generated in another system, or for any other sort of atypical payment approach.
Because all the customer-facing language strings in FoxyCart are editable you could easily change this PO field to read, “Digital Signature” or anything else, which allows a bit more flexibility. You could also hide this field entirely and populate it with a value from the FoxyCart JSON (an affiliate ID, perhaps), allowing an order without an online payment method.
Testing
Testing is done through FoxyCart. There are no special requirements. Simple leave your “payments” section in test mode and process orders using any PO value you'd like.
Important Notes and Caveats
The Purchase Order field is required to be non-empty, so while there is no validation, it cannot be empty.
An active FoxyCart subscription is required in order to access and use the Purchase Order option.
Downloadable products paid for by a Purchase Order won't send download links to customers. You will need to manually send them the download links for their purchase.
Auto-fill and hide the Purchase Order field
If you're using the Purchase Order method as a stand-in for an offline payment approach — a quote, cash on pickup, an invoice, or a bank transfer — you can pre-fill the Purchase Order field with a fixed value and hide it from the customer. The order still goes through with no online payment collected.
Step 1: Enable Purchase Orders
In your Foxy admin, open the payments section for your store and enable the Purchase Order payment method. An active Foxy subscription is required to use it.
Step 2: Populate the Purchase Order field from your checkout template
In your custom checkout template, add the following immediately after the {% embed 'checkout.inc.twig' %} line:
{% block payment_method %}
{% set purchase_order = "Quote" %}
{{ parent() }}
{% endblock %}Change "Quote" to whatever value suits your payment approach — for example "Cash On Pickup" or "Bank Transfer".
Step 3: Hide the Purchase Order field with custom CSS
Add the following to your store's custom header, under your template configuration settings. This hides the input while leaving the Purchase Order option itself visible:
<style type="text/css">
#fc #fc-payment-method-purchase-order .fc-form-group {
display: none;
}
#fc #fc-payment-method-purchase-order .fc-input-group-container--active {
padding-bottom: 0px;
}
#fc #fc-payment-method-purchase-order .fc-input-group-container__title {
border-radius: 5px;
}
</style>To hide the Purchase Order block entirely — including its title — use this instead:
<style type="text/css">
#fc #fc-payment-method-purchase-order {
display: none;
}
</style>Step 4 (optional): Rename the field on the checkout
All customer-facing text in Foxy is editable. On your template set's language strings page, search for "purchase order" and "pay with purchase order" to change how the method is labelled at checkout — for example to "Invoice me" or "Digital signature".
Step 5 (optional): Add payment instructions to the receipt
If the customer still needs to pay you offline, you can append instructions to the receipt only when a purchase order was used. Add the following to the top of your custom web receipt template:
{% if purchase_order %}
{% set custom_purchase_order_message = '<br><br><h4>Bank Transfer Details</h4><p><span style="text-decoration: underline;">BSB</span>: 123 456 | <span style="text-decoration: underline;">Account Number</span>: 9876 54321 | <span style="text-decoration: underline;">Bank</span>: My Bank</p>' %}
{% set custom_lang = config.lang|merge({ "receipt_message_order": config.lang.receipt_message_order ~ custom_purchase_order_message }) %}
{% set config = config|merge({"lang": custom_lang }) %}
{% endif %}And the following to the top of your custom HTML email receipt template:
{% if purchase_order %}
{% set custom_purchase_order_message = '<br><h2 style="margin:0;padding:0;font-family:Verdana,Helvetica,Arial,sans-serif;color:#666666;font-weight:normal;font-size:18px;margin-bottom:10px">Bank Transfer Details</h2><p style="margin-top:0; margin-bottom:30px"><span style="text-decoration: underline;">BSB</span>: 123 456 | <span style="text-decoration: underline;">Account Number</span>: 9876 54321 | <span style="text-decoration: underline;">Bank</span>: My Bank</p>' %}
{% set custom_lang = config.lang|merge({ "email_html_message_order": config.lang.email_html_message_order ~ custom_purchase_order_message }) %}
{% set config = config|merge({"lang": custom_lang }) %}
{% endif %}Replace the bank details in both snippets with your own.