When click on add to cart button, the Woocommerce shows the message, view cart, I want to edit this message, actually edit all the span, put some icon etc...
Have you tried a filter like the following
function your_add_to_cart_message() {
if ( get_option( 'woocommerce_cart_redirect_after_add' ) == 'yes' ) :
$message = sprintf( '%s%s', __( 'Successfully added to cart.', 'woocommerce' ), esc_url( get_permalink( woocommerce_get_page_id( 'shop' ) ) ), __( 'Continue Shopping', 'woocommerce' ) );
else :
$message = sprintf( '%s%s', __( 'Successfully added to cart.' , 'woocommerce' ), esc_url( get_permalink( woocommerce_get_page_id( 'cart' ) ) ), __( 'View Cart', 'woocommerce' ) );
endif;
return $message;
}
add_filter( 'wc_add_to_cart_message', 'your_add_to_cart_message' );
In reply to the ajax message update, try a translation function like:
function your_woo_ajax_solution( $translation, $text, $domain ) {
if ( $domain == 'woocommerce' ) { // your domain name
if ( $text == 'View Cart' ) { // current text that shows
$translation = 'Basket updated.'; // The text that you would like to show
}
}
return $translation;
}
add_filter( 'gettext', 'your_woo_ajax_solution', 10, 3 );