WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Remove hyperlink from product name in cart (3 posts)

  1. ak47marx
    Member
    Posted 1 year ago #

    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/

  2. Roy Ho
    Member
    Posted 1 year ago #

    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() );
  3. ak47marx
    Member
    Posted 1 year ago #

    Thank You so much :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.