2

How to remove "has been added to your cart" text from shopping cart page and how to replace quantity and add to cart button with custom button ( my image ) for it to look like this

This is how it looks now: .

I used Loic's css code in my child style.css to remove text in cart page but it didn't work...

This is entire code in my child style.css file (Am I missing something):

.woocommerce-checkout .woocommerce .woocommerce-message {
display:none !important;}
LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Dragonknigh
  • 29
  • 1
  • 6

2 Answers2

2

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it).

REMOVE MESSAGE:

add_filter( 'wc_add_to_cart_message_html', '__return_null' );

EDIT MESSAGE:

add_filter( 'wc_add_to_cart_message_html','msg_custom_add_to_cart_message' );
function msg_custom_add_to_cart_message() { 
global $woocommerce;
$return_to  = get_permalink(woocommerce_get_page_id('shop'));
$message    = sprintf('<a href="%s" class="button wc-forwards">%s</a> %s', $return_to, __('Continue Shopping', 'woocommerce'), __('Product successfully added to your cart.', 'woocommerce') );
return $message;
}
Meet Makadia
  • 236
  • 1
  • 6
2

There is multiple ways:

1) Using PHP (the best way):

add_filter( 'wc_add_to_cart_message_html', '__return_false' );

Code goes in function.php file of your active child theme (or active theme).

2) Using CSS (not recommended: As it's on cart page, it will hide all other notices):

.woocommerce-cart .woocommerce .woocommerce-message { 
    display:none !important;
}

Goes in styles.css file of your active child theme (or active theme).


To change add to cart button styling try this CSS rules:

.button.alt.single_add_to_cart_button {
    background-color: #36ae33 !important;
    color: #ffffff !important;
}

Goes in styles.css file of your active child theme (or active theme).

You will have to add some other rules to change, font attributes and padding…

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399