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

closed as off-topic by toscho Jul 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.

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

1 Answer 1

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.