Buy direct for checkuot - by oscanecos - on WordPress WooCommerce support

This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago ago by Eva Kemp

  • Avatar: oscanecos
    oscanecos
    Participant
    August 19, 2015 at 21:49

    Hello, i would like to, when the client click to buy, he be directly to checkout page and don’t just atualize de basquet, but change the page to checkout. There, he can decide if finish the buy our continues buying

    5 Answers
    Avatar: Robert Hall
    Robert Hall
    Support staff
    August 20, 2015 at 10:32

    Hello,

    If you need to redirect the user directly to the checkout page instead of the current product page or cart page, put this snippet to your Child theme functions.php file.

    /**
     * Redirect user to checkout page directly after adding to cart
     *
     * @return string 
     */
    function wc_redirect_to_checkout() {
        $checkout_url = WC()->cart->get_checkout_url();
     
        return $checkout_url;
    }
     
    add_filter( 'woocommerce_add_to_cart_redirect', 'wc_redirect_to_checkout' );

    Regards,
    Robert Hall.

    Avatar: oscanecos
    oscanecos
    Participant
    August 21, 2015 at 02:46

    I’m sorry to tell you that doesen’t work.

    Avatar: Robert Hall
    Robert Hall
    Support staff
    August 21, 2015 at 07:43

    Hello,

    You didn’t create the Child Theme.
    Please provide us with FTP credentials in Private Content.

    Regards,
    Robert Hall.

    Avatar: oscanecos
    oscanecos
    Participant
    August 21, 2015 at 17:31

    I don’t know what is, our how to create a child theme.

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Support staff
    August 21, 2015 at 18:01

    Hello,

    I’ve created a child theme and added the code in functions.php file in the directory wp-content/themes/royal-child. Please clear browser cache and check products now.

    Regards,
    Eva Kemp.

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.