Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

Thanks

share|improve this question
1  
a free wordpress plugin to achieve that : wordpress.org/plugins/woocommerce-direct-checkout –  Terry Jul 24 '13 at 16:15
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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