Buy Now button

Asked

Viewed 323 times

0

In the Woocommerce store I have the Add Cart button, I would like to put one beside Buy now that forwards the user direct at 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 to this image, one of the buttons takes the user to the shopping cart and the other straight to the checkout inserir a descrição da imagem aqui

  • But what’s your problem? Be more specific about how we can help you...

  • In the store template I only have the Add Cart button,I would like to add another button next to it that directs the user directly to the checkout, like a Buy Now

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.