WooCommerce product links can be removed from shopping cart and thank you page. woocommerce_cart_item_permalink
filter deals with the product permalink on shopping cart page. And woocommerce_order_item_permalink
filter deals on thank you page. Returning false will simply remove product links from those pages.
/**
* Remove product link from cart
*/
add_filter( 'woocommerce_cart_item_permalink','__return_false' );
/**
* Remove product link from thank you page
*/
add_filter( 'woocommerce_order_item_permalink', '__return_false' );
In the above code, __return_false
is a default WordPress function, which always returns false
.
Code goes in the functions.php
file of your active theme.