[Edit: Added example page]
I downloaded a plugin so that on the WooCommerce hand-picked products block, I’d be able to replace the add to cart button with a direct purchase link.
The problem is that the product image still links to the product page.
How can I remove this link?
I tried adding the below code that I found to the functions file, but it doesn’t work. The code author says that if it doesn’t work, it could be because the hooks and/or priorities of the theme could be different. Could you please advise?
if ( is_product() && is_product_category( array(‘nocartcat’) ) ) {
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 );
}