I’ve tried editing the empty cart message, but the changes made does not seem to show on the front end.
From the usual text “No products in the cart.” to “Oops! Looks like your cart is empty.” I’ve also tried the code provided by numerous other similar questions asked, but none seem to work either.
I tried using the following code in the mini-cart.php file;
<p class="woocommerce-mini-cart__empty-message"><?php esc_html_e( 'Oops! Looks like your cart is empty.', 'woocommerce' ); ?></p>
and also tried using the following code in the functions.php file;
add_action( 'init', 'woocommerce_clear_cart_url' );
function woocommerce_clear_cart_url() {
global $woocommerce;
if ( isset( $_GET['empty-cart'] ) ) {
$woocommerce->cart->empty_cart();
}
}
add_action( 'woocommerce_widget_shopping_cart_buttons', 'add_clear_cart_button', 10, 2 );
function add_clear_cart_button() {
?>
<a class="button" href="<?php echo $woocommerce->cart->get_cart_url(); ?>?empty-cart"><?php _e( 'Empty Cart', 'woocommerce' ); ?></a>
<?php
}