Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save FrancoStino/9344dcb62919cf4281466f64f65ac881 to your computer and use it in GitHub Desktop.
Save FrancoStino/9344dcb62919cf4281466f64f65ac881 to your computer and use it in GitHub Desktop.
Adding a custom text under the X button that removes items from cart
<?php
add_filter('woocommerce_cart_item_remove_link', 'remove_icon_and_add_text', 10, 2);
function remove_icon_and_add_text($string, $cart_item_key) {
$string = str_replace('class="remove"', '', $string);
return str_replace('&times;', '<span class="remove-text" style="font-size:0.9em; display:block;">Rimuovi prodotto', $string);
}
/* ADD CSS */
td.product-remove a, .woocommerce-remove-coupon {
display: inline;
font-size: unset;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment