Buy Now Option? NO ADD TO CART (2 posts)

  1. robgranholm
    Posted 3 years ago #

    I can't seem to find a way to make a product have a buy now option only, which leads right to checkout, changing or customizing the add to cart button basically to be a buy now?!


  2. IgniteWoo Team
    Posted 3 years ago #

    To have the add to cart action redirect into checkout try putting this in your theme's functions.php file ( assuming your theme has a functions.php file )

    add_filter ( 'add_to_cart_redirect', 'custom_redirect_to_checkout', 20, 1 );
    function custom_redirect_to_checkout( $url = '' ) {
        global $woocommerce;
        $checkout_url = $woocommerce->cart->get_checkout_url();
        return $checkout_url;

    Note: If you use that code it will affect all products. If you want this to only affect specific products then you need a bit more code in the function that takes into consideration which product is being added to the cart.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.