• ak47marx

    (@ak47marx)


    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

    https://www.ads-software.com/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() );
    Thread Starter ak47marx

    (@ak47marx)

    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.