WordPress.org

Support

Support » Plugins and Hacks » Remove hyperlink from product name in cart

Remove hyperlink from product name in cart

  • Hi, how to remove hyperlink from the product in cart?

    In ../woocommerce/templates/cart/cart.php i have:

    <!-- Product Name -->
    						<td class="product-name">
    							<?php
    								if ( ! $_product->is_visible() || ( $_product instanceof WC_Product_Variation && ! $_product->parent_is_visible() ) )
    									echo apply_filters( 'woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key );
    								else
    									printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key ) );

    How to change the link part so that only text of the product is visible with no hyperlink?

    Thanks

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Roy Ho

    @splashingpixelscom

    Change this:

    printf('<a href="%s">%s</a>', esc_url( get_permalink( apply_filters('woocommerce_in_cart_product_id', $values['product_id'] ) ) ), apply_filters('woocommerce_in_cart_product_title', $_product->get_title(), $values, $cart_item_key ) );

    TO

    echo apply_filters( 'woocommerce_in_cart_product_title', $_product->get_title() );

    Thank You so much 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove hyperlink from product name in cart’ is closed to new replies.