Buy Now button

0

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>';
}
Something similar like this image, one of the buttons takes the user to the shopping cart and the other direct to the checkout     
asked by anonymous 04.04.2018 / 20:37

0 answers