WooCommerce: Deposit Payment @ Order Pay Page

In WooCommerce, the order pay page is a specific webpage a customer lands on to complete payment for an order. It’s typically used for manual orders.

When a store admin creates an order in the WooCommerce backend, the system generates a unique URL for the order pay page. This link can then be shared with the customer via email or other means, allowing them to submit payment.

The question is – what if we want the customer to pay a deposit / first installment / partial payment on the Order Pay page (say the order total is $999, and you want them to pay $111 only)?

Well, we could use a URL parameter – if that’s present and the value is lower than the order total, we can “filter” the order total and let the customer pay whatever amount. Let’s see how it’s done!

As you can see, the order total is $997 but I managed to force the payment due to $111, thanks to the snippet below and a URL parameter. This is the “Order Pay” page for a pending WooCommerce order.

PHP Snippet: Force Deposit Payment @ WooCommerce Order Pay Page

Order Pay page URLs look like e.g. https://example.com/checkout/order-pay/123456/?pay_for_order=true&key=wc_order_Lertgern4556454DFG4a – as you can see, it already comes with URL parameters!

All we need to do now is add one more parameter – for example “dep” or whatever you wish – followed by an amount that must be less than the order total ($999 in our example): &dep=111

Final URL will be https://example.com/checkout/order-pay/123456/?pay_for_order=true&key=wc_order_Lertgern4556454DFG4a&dep=111

Now that we have “dep” and its “111” value in the URL, we can use the snippet below to alter the order total on the go:

/**
 * @snippet       Deposit Payment @ WooCommerce Order Pay
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 8
 * @community     https://businessbloomer.com/club/
 */

add_filter( 'woocommerce_order_get_total', 'bbloomer_order_pay_deposit', 9999, 2 );

function bbloomer_order_pay_deposit( $total, $order ) {
	if ( is_checkout_pay_page() && isset( $_GET['dep'] ) ) {
		return (int) $_GET['dep'];
	}
	return $total;
}

Where to add custom code?

You should place custom PHP in functions.php and custom CSS in style.css of your child theme: where to place WooCommerce customization?

This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101

Related content

  • WooCommerce: Allow to “Pay for Order” Without Login
    Some plugins such as “deposit” and “subscription” payments send customers to the “Pay for Order” page in order to complete a pending WooCommerce order. In certain cases, also, the customer is forced to log in and this really affect sales conversion rate – instead of the checkout form customers see this notice: “Please log in […]
  • WooCommerce: Enable Payment Gateway Only for “Order Pay Checkout”
    I invoice clients via WooCommerce, and then send them the “Invoice Email”, which takes them to the “Order Pay” page. Of course, I want to give them the option to pay via “Bank Transfer” (bacs), but I don’t want this to be visible on the default checkout page. We’ve seen in the past how to […]
  • WooCommerce: Display Customer Address @ Order Pay
    The WooCommerce Order Pay page URL is generated by the store admin while creating a manual order from the backend. This URL is then forwarded onto the client, where they can pay for the order and complete their purchase. The other annoying thing about the order pay page, together with strict page permissions, is the […]
  • WooCommerce: Turn Checkout Into a Quote System
    There are certainly ways and plugins to turn WooCommerce into a quote engine, but today I want to share a super simple workaround that could be helpful to many. In a nutshell, we’ll use the same WooCommerce cart/checkout flow, rename a few strings and buttons, enable an offline payment gateway (so there is no actual […]
  • WooCommerce: Add Content To The “Order Pay” Page
    The WooCommerce “Order Pay” page is a hidden gem within the checkout process. It’s not typically encountered during a standard customer purchase journey – it comes into play when a store admin creates a manual order in the WooCommerce backend and sets it to “Pending” order status, often for scenarios like phone orders or custom […]

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

Questions? Feedback? Customization? Leave your comment now!
_____

If you are writing code, please wrap it like so: [php]code_here[/php]. Failure to complying with this, as well as going off topic or not using the English language will result in comment disapproval. You should expect a reply in about 2 weeks - this is a popular blog but I need to get paid work done first. Please consider joining the Business Bloomer Club to get quick WooCommerce support. Thank you!

Your email address will not be published. Required fields are marked *