Skip to content
Docs
Get RestroPress

Filter

rpress_checkout_service_fee_sublabel

Updated
On this page

Filters the sublabel shown under a checkout service chip.

Runs first in rpress_get_checkout_service_fee_sublabel(). Return a string, including an empty string to show no sublabel, to replace the computed text. Return null to let core compute it from the displayed fee, free-delivery threshold and fee extensions.

Parameters#

ParameterTypeDescription
$sublabelnullDefault null, meaning no override.
$service_typestringService type of the chip, delivery or pickup.
$currentstringService type currently selected (from the service_type cookie), or an empty string.

Return value#

string|null. Sublabel text, or null to use the default.

Example#

function my_service_chip_sublabel( $sublabel, $service_type, $current ) {
	if ( 'pickup' === $service_type ) {
		return __( 'Ready in 15 minutes', 'my-plugin' );
	}
	return $sublabel;
}
add_filter( 'rpress_checkout_service_fee_sublabel', 'my_service_chip_sublabel', 10, 3 );

Source#

Applied in:

  • includes/rp-delivery-fee-basic.php (line 93), in rpress_get_checkout_service_fee_sublabel()

See also#

Was this page helpful?