WooCommerce - How to make product images non-clickable for affiliate/external products

If you are creating affiliate/external products in WooCommerce and would like users to only be able to click directly on your product URL button, we'll show you how! This will effectively prevent users from accessing the single product pages and force them to click the product button.

1. Go to Appearance > Theme File Editor > Functions.php.

2. Scroll to the end and paste the following code snippet:

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);

3. Click Save File.