L
L
LastGeneral2021-04-20 20:32:43
WordPress
LastGeneral, 2021-04-20 20:32:43

How to make the checkout process faster?

There will be 5-6 products in the store, it makes no sense to throw them into the basket first, then proceed to checkout. How to make it so that the client would immediately go to checkout by clicking on the selected product?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lev Rozanov, 2021-04-20
@LastGeneral

function skip_cart_and_redirection_to_checkout() {

    if (is_cart()) {
        wp_redirect(wc_get_checkout_url());
        // wp_redirect( WC()->cart->get_checkout_url() ); для WC < 3
    }
}
add_action('template_redirect',  'skip_cart_and_redirection_to_checkout');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question