You need to use the WooCommerce hook woocommerce_after_add_to_cart_button
. It will add content after the "Add to cart" button.
Also, a product can be added to the cart with a link like this
http://example.com/cart/?add-to-cart=<product ID>
Using both that is above the hook and this link, you can add a second button with this snippet:
function add_content_after_addtocart() {
// get the current post/product ID
$current_product_id = get_the_ID();
// get the product based on the ID
$product = wc_get_product( $current_product_id );
// get the "Checkout Page" URL
$checkout_url = WC()->cart->get_checkout_url();
// run only on simple products
if( $product->is_type( 'simple' ) ){
echo '<a href="'.$checkout_url.'?add-to-cart='.$current_product_id.'" class="single_add_to_cart_button button alt">Checkout</a>';
}
}
add_action( 'woocommerce_after_add_to_cart_button', 'add_content_after_addtocart' );
It will add a button after the normal Add to cart button on single product pages.