Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1097511

    be3designs
    Participant

    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.

    #1097584

    Rahul
    Moderator

    Hey 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!

    #1097609

    be3designs
    Participant

    Thank you!

    #1098018

    Friech
    Moderator

    You’re more than welcome, glad we could help.

    Cheers!

    #1098019

    Nico
    Moderator

    You’re most welcome.

    Feel free to ask us again.

    Thanks.

    #1143783

    Larry K
    Participant

    Hi,
    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

    #1144289

    Paul R
    Moderator

    Hi 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.