Skip to content
Docs
Get RestroPress

Filter

rp_added_to_cart

Updated
On this page

Filters the notice text shown after an item is added to the cart.

Runs in RP_Frontend_Scripts::load_scripts() and is localised as the added_to_cart string of the rp_scripts object. The default starts with a space because the script appends it after the menu item name.

Parameters#

ParameterTypeDescription
$textstringNotice suffix, is added to cart by default (with a leading space).

Return value#

string. The notice text, normally starting with a space.

Example#

function my_added_to_cart_text( $text ) {
	return __( ' was added to your order', 'my-textdomain' );
}
add_filter( 'rp_added_to_cart', 'my_added_to_cart_text' );

Source#

Applied in:

  • includes/class-rpress-frontend-scripts.php (line 322), in RP_Frontend_Scripts::load_scripts()

See also#

Was this page helpful?