Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save themepaint/ae34578f29869f5a63bbe929ff02f0f3 to your computer and use it in GitHub Desktop.

Select an option

Save themepaint/ae34578f29869f5a63bbe929ff02f0f3 to your computer and use it in GitHub Desktop.

Revisions

  1. themepaint created this gist Oct 7, 2016.
    13 changes: 13 additions & 0 deletions Woocommerce product type detection and cart text change
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@

    add_filter( 'woocommerce_product_single_add_to_cart_text', 'custom_single_add_to_cart_text' );

    function custom_single_add_to_cart_text() {
    global $product;
    if( $product->is_type( 'variable' ) ){

    return __( 'HD Download', 'woocommerce' );

    }else{
    return __( 'Add to Cart', 'woocommerce' );
    }
    }