Frankolin Frankolin - 2 months ago 25
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


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:

    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.