Remove add to cart icon/view product button woocommerce

Question

I’m trying to remove a button that appears when hovering over the images on a woocommerce shop. (See images attached)
icon that appears
The product is a variable product.

Failing being able to do this I also tried to format it so it’s a normal ‘view product’ button using the below code. However I’m struggling on how else to format it.
Any help much appreciated.

// Change button text on WooCommerce Shop pages
add_filter( 'woocommerce_product_add_to_cart_text', 'woocustomizer_edit_shop_button_text' );

function woocustomizer_edit_shop_button_text() {
    global $product;
    $product_type = $product->get_type(); // Get the Product Type

    // Change text depending on Product type
    switch ( $product_type ) {
        case "variable":
            return __( '£', 'woocommerce' );
            break;
        case "grouped":
            return __( 'View All Products', 'woocommerce' );
            break;
        case "external":
            // Button label is added when editing the product
            return esc_html( $product->get_button_text() );
            break;
        default:
            return __( 'Buy Now', 'woocommerce' );
    }
}
0
, , , , Gwell 4 years 2020-03-25T20:51:46-05:00 0 Answers 109 views 0

Leave an answer

Browse
Browse