I am replaced add to cart button with the buy now button. Now I want to add content after the buy now button.
But I can’t find out an action or filter hook which works for this so far. This is the modified Buy Now button code.
function woocommerce_external_add_to_cart() {
global $product;
if ( ! $product->add_to_cart_url() ) return;
echo '<p><a href="' . $product->add_to_cart_url() . '" class="single_add_to_cart_button button alt" target="_blank"><svg width="50" height="50" viewBox="0 0 50 50"><path
d="M50,0V38.486a2.565,2.565,0,0,1-5.09.46l-.04-.46L44.861,9.359a.25.25,0,0,0-.425-.18L4.379,49.245a2.565,2.565,0,0,1-3.275.3l-.35-.3a2.565,2.565,0,0,1-.3-3.275l.3-.355L40.8,5.559a.25.25,0,0,0-.175-.43H11.509a2.565,2.565,0,0,1-2.525-2.1l-.04-.47a2.567,2.567,0,0,1,2.1-2.525L11.514,0Z"
fill="currentColor"></path></svg>' . $product->single_add_to_cart_text() . '</a></p>';
I highly appreciate your help and suggestions in this regard.
2
Answers
you can use this code for it
this is direct checkout button