WooCommerce: Remove Add Cart, Add View Product @ Shop Page

PHOTO EMBED

Fri Jul 01 2022 06:59:14 GMT+0000 (UTC)

Saved by @peterteszary #php

/**
 * @snippet       Remove Add Cart, Add View Product @ WooCommerce Loop
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @testedwith    WooCommerce 6
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
 
// First, remove Add to Cart Button
 
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
 
// Second, add View Product Button
 
add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_view_product_button', 10 );
 
function bbloomer_view_product_button() {
   global $product;
   $link = $product->get_permalink();
   echo '<a href="' . $link . '" class="button addtocartbutton">View Product</a>';
}
content_copyCOPY

https://www.businessbloomer.com/woocommerce-remove-add-cart-add-view-product-loop/