WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Buy Now Option? NO ADD TO CART (2 posts)

  1. robgranholm
    Member
    Posted 1 year 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?!

    http://wordpress.org/extend/plugins/woocommerce/

  2. IgniteWoo
    Member
    Posted 1 year 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

About this Topic

Tags

No tags yet.