WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to redirect to the checkout page directly upon clicking the "add to cart" button. Or a Direct Buy Now Feature.

How can this be done?


share|improve this question

closed as off-topic by toscho Jul 14 '14 at 12:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

a free wordpress plugin to achieve that : wordpress.org/plugins/woocommerce-direct-checkout – user35736 Jul 24 '13 at 16:15

My friend Ewout just answered this question a couple months ago on stackoverflow. Add the following to your theme's functions.php file:

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;

Here's a link to his answer: http://stackoverflow.com/a/15597933/1543310

share|improve this answer

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