Skip to content
Docs
Get RestroPress

Filter

rpress_cart_sidebar_render_fee

Updated
On this page

Filters whether a fee is listed in the sidebar cart totals.

Runs in the sidebar cart totals template for each fee in the cart. Return false to skip the fee row. This only hides the row; the fee is still part of the cart total.

Parameters#

ParameterTypeDescription
$renderboolWhether to show the fee row. Defaults to true.
$fee_idstringThe fee ID, the key from rpress_get_cart_fees().
$feearrayThe fee data, including the label and amount keys.

Return value#

bool. True to show the fee, false to hide it.

Example#

function my_render_cart_fee( $render, $fee_id, $fee ) {
	if ( 'my_service_fee' === $fee_id ) {
		return false;
	}
	return $render;
}
add_filter( 'rpress_cart_sidebar_render_fee', 'my_render_cart_fee', 10, 3 );

Notes#

Core hides the delivery fee row in the sidebar when the service type cookie is pickup, using rpress_cart_sidebar_hide_delivery_fee_on_pickup.

Source#

Applied in:

  • templates/cart/checkout.php (line 46)

See also#

Was this page helpful?