I want to add another button beside “add to cart” on single product page that will add the product to cart and also take the user to checkout page .

if I will use

add_filter ('add_to_cart_redirect', 'redirect_to_checkout');

function redirect_to_checkout() {
    global $woocommerce;
    $checkout_url = $woocommerce->cart->get_checkout_url();
    return $checkout_url;
}

this will override the add to cart button, but I want it to be like it is and want another button that will do this job ? is it possible with hooks ?

Read more here: Adding a skip to checkout button woocmmerce


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: