84
Today we take a look at the WooCommerce Loop / Shop Page and specifically at how to disable the link to the single products.
Some store owners prefer to skip the single product page, and simply have customers add to cart from the shop page. Enjoy!
PHP Snippet: Disable Link to Products @ WooCommerce Shop / Category / Loop Pages
Thank you Daymobrew for your very elegant alternative to my initial hack 🙂 I love when 2 lines of code achieve a better result than 10!
/**
* @snippet Disable Link to Products @ Loop
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @testedwith WooCommerce 4.0
* @donate $9 https://tutoraspire.com
*/
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 );