Skip to content
Docs
Get RestroPress

Filter

rpress_store_header_delivery_chip

Updated
On this page

Filters the delivery fee chip text shown in the store header or the menu page store card.

The incoming text is built from the core flat delivery fee, only while that flat fee is active and greater than zero; otherwise it is an empty string. Return your own text, for example from a zone or distance pricing extension, or an empty string to show no chip. The text is escaped on output, so HTML is not rendered.

Available since RestroPress 3.5.1.

Parameters#

ParameterTypeDescription
$delivery_chipstringChip text, or '' for no chip.
$contextstring'header' for the Modern pack store header, 'store_card' for the menu page store card.

Return value#

string. Chip text, or '' to hide the chip.

Example#

add_filter( 'rpress_store_header_delivery_chip', 'my_delivery_chip', 10, 2 );
function my_delivery_chip( $delivery_chip, $context ) {
	if ( 'store_card' === $context ) {
		return __( 'Delivery fee depends on distance', 'my-plugin' );
	}
	return $delivery_chip;
}

Notes#

In the store card the filter runs only when the service being shown is delivery. The two contexts start with different default wording.

Source#

Applied in:

  • includes/class-rpress-template-packs.php (line 227), in RPRESS_Template_Packs::render_modern_store_header()
  • includes/features/mobile-ordering/functions.php (line 193), in rpress_mobile_ordering_store_state()
Was this page helpful?