filters - Remove add to cart iconview product button woocommerce

I'm trying to remove a button that appears when hovering over the images on a woocommerce shop. (See images attache

I'm trying to remove a button that appears when hovering over the images on a woocommerce shop. (See images attached) 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' );
    }
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744636250a4585159.html

相关推荐

  • filters - Remove add to cart iconview product button woocommerce

    I'm trying to remove a button that appears when hovering over the images on a woocommerce shop. (See images attache

    2天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信