WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » Buy Now Option? NO ADD TO CART

Buy Now Option? NO ADD TO CART

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Buy Now Option? NO ADD TO CART’ is closed to new replies.
Skip to toolbar