Frankolin Frankolin - 10 days ago 5
Javascript Question

Wocommerce sliding cart - add remove button for each product

I use WooCommerce Cart Tab.
It is possible to add a remove button for a product?

enter image description here

Answer

It's very simple to do this:

Navigate to wp-content/plugins/woocommerce/templates/cart and open mini-cart.php. Inside the li tag, add the following code:

<?php
    echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">&times;</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __( 'Remove this item', 'woocommerce' ) ), $cart_item_key );
?>

This will add a remove button (a X) for each product in your sliding cart.

And you're done.