• Resolved Lee Hodson (VR51)

    (@leehodson)


    You could add the option to remove the image link from the product loop. I have done this using the below snippet. Replacing the anchor link with a div assists with style customization.

    function vr51_woocommerce_template_loop_product_link_open() {
        echo '<div class="woocommerce-LoopProduct-container">';
    }
    
    function vr51_woocommerce_template_loop_product_link_close() {
        echo '</div>';
    }
    
    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    add_action( 'woocommerce_before_shop_loop_item', 'vr51_woocommerce_template_loop_product_link_open', 10 );
    add_action( 'woocommerce_after_shop_loop_item', 'vr51_woocommerce_template_loop_product_link_close', 5 );

    Though I use a div you could instead keep the A tag but remove the target product page link. This would retain any theme styles applied to a.woocommerce-LoopProduct-link.

    Thanks for your plugin. I found it useful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @leehodson,

    Sorry but I’m not sure how this relates to the WooCommerce External Product New Tab plugin as the plugin does not alter anything related to product images?

    The plugin only changes the add to cart buttons within WooCommerce to open in a new tab if the product is an external/affiliate product.

    Thread Starter Lee Hodson (VR51)

    (@leehodson)

    Hi Stuart,

    It relates because some/many stores that sell affiliate products have no need for individual product pages to be accessed from the product loop.

    Plugin Author Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @leehodson,

    It relates because some/many stores that sell affiliate products have no need for individual product pages to be accessed from the product loop.

    What you describe above still does not directly relate to the functionlaity or purpose of the WooCommerce External Product New Tab plugin?

    The plugin only changes the WooCommerce add to cart buttons on product archives and single product pages to open external links in a new tab if the product is an affiliate/external product?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Suggestion: Remove The Image Link Too’ is closed to new replies.