Tagged: x
-
AuthorPosts
-
July 21, 2016 at 2:41 pm #1097511
What file can I find the area in which to remove links to the single product pages from both the main shop/archive page and any widgets that show product feeds?
I tried following some WooCommerce walkthroughs including adding a function to remove the links but nothing works and I’ve been told it’s likely due to a theme rewrite.
I am trying to remove the link to the single product page from both the product image and the product title in any widgets and archive pages that list products.
July 21, 2016 at 3:16 pm #1097584Hey There,
Thanks for writing in.
If you do that, user won’t able to add to cart some of your products so be aware about what you are going to do.
You can add this code at Admin > Appearance > Customizer > Custom > Javascript
jQuery( function( $ ) { $('.entry-product .entry-featured a, .entry-product .entry-header a[href!="/?add-to-cart="], .woocommerce-cart .shop_table.shop_table_responsive.cart a').on( 'click', function(e) { e.preventDefault(); } ); } );
Hope that helps!
Thanks!
July 21, 2016 at 3:37 pm #1097609Thank you!
July 21, 2016 at 8:43 pm #1098018You’re more than welcome, glad we could help.
Cheers!
July 21, 2016 at 8:43 pm #1098019You’re most welcome.
Feel free to ask us again.
Thanks.
August 23, 2016 at 4:27 pm #1143783Hi,
I’m wanting to do the same thing, EXCEPT I don’t want to prevent anyone from adding to cart.my issue, the products DO NOT have a “larger” image to view… so in reality, its a WASTED click. not good.
I just want to remove the link, when a person is looking at the product detail page.how to do that?
thanks
August 24, 2016 at 1:55 am #1144289Hi Larry,
To disable the links, you can add this under Custom > Edit Global CSS in the Customizer.
.single-product div.product .images a { pointer-events: none; cursor: default; }
Hope that helps.
-
AuthorPosts