Filter
rpress_cart_sidebar_summary_html
On this page
Filters the HTML of the sidebar cart summary.
Runs in rpress_get_cart_sidebar_summary_html() after the cart/checkout template part is rendered into a string. The function returns an empty string without running the filter when the cart is empty.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$html | string | Rendered summary markup (totals, charges and checkout row). |
Return value#
string. The summary HTML.
Example#
function my_cart_sidebar_summary_html( $html ) {
return $html . '<p class="my-cart-note">' . esc_html__( 'Free napkins on request.', 'my-textdomain' ) . '</p>';
}
add_filter( 'rpress_cart_sidebar_summary_html', 'my_cart_sidebar_summary_html', 10, 1 );
Notes#
The output is printed by the caller as HTML, so escape anything you add.
Source#
Applied in:
includes/cart/template.php(line 66), inrpress_get_cart_sidebar_summary_html()
Was this page helpful?
