WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Cart Tab
Adding a "Remove item"-button? (3 posts)

  1. jesperb
    Member
    Posted 1 year ago #

    I'd like to be able to remove items from the cart directly from the cart tab. Any chance it's an easy fix?

    Thanks!

    http://wordpress.org/extend/plugins/woocommerce-cart-tab/

  2. Kimber254
    Member
    Posted 8 months ago #

    Same question here

  3. leonardinha
    Member
    Posted 1 month ago #

    I added this code to mini-cart.php, located in /wp-content/plugins/woocommerce/templates/cart/mini-cart.php

    <?php echo apply_filters( 'woocommerce_cart_item_remove_link', sprintf('<a href="%s" title="%s">× Rimuovi</a>', esc_url( $woocommerce->cart->get_remove_url( $cart_item_key ) ), __( 'Rimuovi il prodotto dal carrello', 'woocommerce' ) ), $cart_item_key ); ?><?php echo WC()->cart->get_item_data( $cart_item ); ?>

    The exact position, (in my php at line 43) is after the code (still present in the file)

    <a href="<?php echo get_permalink( $product_id ); ?>"> <?php echo str_replace( array( 'http:', 'https:' ), '', $thumbnail ) . $product_name; ?></a>

    I also noticed (in my template) that this code works correctly
    when permalinks are set this way:

    http://www.website.com/%postname%/

    but I don't know if it's the same for other templates.
    Hope this could be helpful!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic