I wish to ADD a "buy now" button on product page , and redirect to checkout page after clicking it but without adding the product into cart.

For example, if there are already products A,B in the cart , and I click the 'buy now' button on another product page of C , A and B in the cart will be still in the cart and remain not checkout, Only C will be in the product list of the checkout page and also C is not adding into cart.

I think this question can't simple be addressed by current wordpress and woocommerce code , I was thinking add another cart and checkout instances only for the "but now" checkout but I am not sure how to do it.

How can I achieve this? Many thanks.


If you do not wish to add the product to the cart them simply go into your content-single-product.php file and create an element that has an anchor tag that links directly to your cart wherever you want it to show up.

so it'd be something like:

<div class='cart-redirect'>
    <a src='http://yoursite.com/cart'>Checkout Now</a>

and just style it to look like a button.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.