In the Woocommerce store I have the Add cart button, I would like to put one next to it Buy now that forwards the user direct in the checkout, I used the following code:
add_action( 'woocommerce_single_product_summary', 'my_extra_button_on_product_page', 30 );
function my_extra_button_on_product_page() {
global $product;
echo '<button type="submit" class="single_add_to_cart_button button alt">Compre agora</button>';
}