Skip to content
Docs
Get RestroPress

Filter

rpress_coupon_applied_html

Updated
On this page

Filters the HTML of the applied-coupon notice on the checkout page.

Applied at the end of rpress_coupon_applied_html(), which builds the notice shown when a coupon is active. The default markup contains a check icon, the code with the discounted amount and a Remove link with the classes rpress-coupon-remove and rpress_discount_remove. Only the first applied code is shown.

Parameters#

ParameterTypeDescription
$htmlstringThe notice HTML.
$codestringThe first applied discount code.
$amountstringThe formatted discounted amount.

Return value#

string. The notice HTML.

Example#

function my_coupon_applied_html( $html, $code, $amount ) {
	return $html . '<small>' . esc_html__( 'Coupon saved to your order.', 'my-plugin' ) . '</small>';
}
add_filter( 'rpress_coupon_applied_html', 'my_coupon_applied_html', 10, 3 );

Source#

Applied in:

  • includes/discount-functions.php (line 860), in rpress_coupon_applied_html()

See also#

Was this page helpful?