Skip to content

Instantly share code, notes, and snippets.

View joedaniels's full-sized avatar

Joe Daniels joedaniels

View GitHub Profile
@joedaniels
joedaniels / functions.php
Created October 23, 2017 21:51
WooCommerce custom added to cart/basket notice message
function add_to_basket_notice($input) {
$input = explode('“', $input);
$title = explode('”', $input[1]);
$title = $title[0];
$message = sprintf( '%s was successfully added to your basket <a href="%s" class="button">%s</a>', esc_html($title), esc_url(wc_get_page_permalink('cart')), esc_html__('View basket', 'woocommerce'));
return $message;
}
add_filter('wc_add_to_cart_message_html', 'add_to_basket_notice');