Filter
rpress_coupon_applied_html
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#
| Parameter | Type | Description |
|---|---|---|
$html | string | The notice HTML. |
$code | string | The first applied discount code. |
$amount | string | The 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), inrpress_coupon_applied_html()
See also#
Was this page helpful?
