Skip to content
Docs
Get RestroPress

Filter

rpress_get_checkout_button_purchase_label

Updated
On this page

Filters the label of the Place Order button.

Runs in rpress_get_checkout_button_purchase_label(). The label is empty when the cart total is zero; otherwise it is the checkout label setting or the default "Place Order".

Parameters#

ParameterTypeDescription
$complete_purchasestringThe button label, empty if the cart total is zero.
$labelstringRaw value of the checkout label setting.

Return value#

string. The button label.

Example#

function my_purchase_label( $complete_purchase, $label ) {
	if ( '' === $complete_purchase ) {
		return $complete_purchase;
	}
	return __( 'Order now', 'my-textdomain' ) . ' (' . rpress_currency_filter( rpress_format_amount( rpress_get_cart_total() ) ) . ')';
}
add_filter( 'rpress_get_checkout_button_purchase_label', 'my_purchase_label', 10, 2 );

Source#

Applied in:

  • includes/checkout/template.php (line 1148), in rpress_get_checkout_button_purchase_label()

See also#

Was this page helpful?