I would like to REMOVE completely the wc_empty_cart_message
. My site has no cart. and when the item is removed from checkout the user is redirected to the home page. But then upon browsing to a shop page, the message "your cart is not available whilst your checkout is empty" appears and is completely unnecessary.
I have seen many of questions/answers about how to change the message to something else (I tried some of them which also did not seem to work).
I tried this which seems to be the right thing to do, but for some reason it does not make any visible change on my website.
remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );
Is there any way to check which hook is creating the message from the front-end? Or any way how I can see what is overruling this command from executing?
2
Answers
Based on the information in the answer from @7uc1f3r and some other tutorials I was checking recently, I discovered that this also does the trick:
To remove the "Your cart is currently empty" message, use:
Where the
remove_action
in anadd_action
with a lower priority number (9)To remove the "Checkout is not available whilst your cart is empty" message, use: