how to make a direct purchase without going through the woocomerce stand?

3

Anyone here knows, if it is possible to use woocommerce so that when someone clicks on buying any product, is it taken directly to the transparent checkout? (without the product going to the cart and the cart to the person clicking on the final purchase)

    
asked by anonymous 29.03.2015 / 06:37

3 answers

4

Latest version

You can check the documentation you have the option to configure the cart page so that when we are supposed to access the cart, we will be accessing another page.

So, two things to let your visitor go to Checkout when they click "Buy":

  • Acedes a Woocommerce > Settings

    Check the option to direct the visitor to the cart when using the "buy" button:

  • AcedesaWoocommerce>Settings>Checkout(Tab):

    Where"Cart" is read, you choose "Checkout" for the "Cart page" so that the cart page is actually "Checkout":

  • Version2.1orhigher

    Anothermethodforversionsfrom2.1istocreateafilterinthefilefunctions.php:

    add_filter ('add_to_cart_redirect', 'redirect_to_checkout'); function redirect_to_checkout() { return WC()->cart->get_checkout_url(); }

    Version less than 2.1

    Versions below 2.1 you can create a filter in the file functions.php , but the function is a little different:

    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;
    }
    
        
    29.03.2015 / 07:49
    0
    /**
     * Set a custom add to cart URL to redirect to
     * @return string
     */
    function custom_add_to_cart_redirect() { 
    return 'http://www.yourdomain.com/your-page/'; 
    }
    add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect');
    
        
    30.06.2016 / 04:41
    0

    You know how I can make two buttons, one to checkout, and another to just add the product to the cart, all in the single product.

        
    12.03.2017 / 18:08