We’ve already seen how to remove the product permalink from the “order table” (the one you see on the Thank you page, My account pages and emails). Thsi time, we’re looking at doing the same thing on the Cart page, which uses different “hooks” than the order pages and therefore requires its own snippet.
Here’s how it’s done – as usual 1 PHP line is sufficient!
PHP Snippet: Delete Cart Item Permalink @ WooCommerce Cart
/** * @snippet Remove Cart Item Link - WooCommerce Cart * @how-to businessbloomer.com/woocommerce-customization * @sourcecode https://businessbloomer.com/?p=80927 * @author Rodolfo Melogli, Business Bloomer * @compatible WooCommerce 3.4.7 */ add_filter( 'woocommerce_cart_item_permalink', '__return_null' );
When I do this it does indeed remove the link but it also makes the text white, even though I have links set to a blue color. I can’t find a workaround for this, please help!
Sounds like a CSS issue to me
Thanks for posting. Still works in august 2022.
Great!
Remove Product Title Permalink for Email Notifications. How do i do that?
https://www.businessbloomer.com/woocommerce-remove-permalink-product-order-table/
Still working perfectly!
Thank you soooo much!!!
Great!
Hi! This does not work for me – maybe because I we are using built-in attributes. After adding this add_filter to functions.php the product links are still there in the cart, example: /shop/traffic-signs/advisory-speed/?attribute_pa_size=45x45cm&attribute_pa_sub=steel-16-guage&attribute_pa_reflct=engineer
I’m actually trying to eliminate the additional variables (starting at ?) and keep the product URL, example: /shop/traffic-signs/advisory-speed/
Not having any luck – been searching for hours.
Sounds odd. Disable all plugins but Woo and switch theme – does the snippet work?
Still works, you are brilliant. Thanks so much.
Btw I need to use Code Snippets tool for it to work.
Ok thank you
Still works. Thanks.
Awesome
Hi, how can we do that only for some products? forexample on my case I am trying to hide wp job manager listing type product from market(shop) and want to users if purchase some listing type its add to cart a product and this product coming to viewable. I just dont want that products viewable. there is a way to configurate this product id?
Hey Ongun, thanks for your comment! I suggest you take a look at “conditional logic”: https://businessbloomer.com/conditional-logic-woocommerce-tutorial/ and https://businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/. Let me know 🙂