mardi 28 juin 2016

WooCommerce Registration Redirect Not Working

Facing a weird issue. The filter isn't working at all. I want the user to redirect to the checkout page after registration. I tried putting the cart url instead of checkout and that too doesn't work. My other redirect with the woocommerce_add_to_cart_redirect filter works fine.

function custom_registration_redirect() {

    global $woocommerce;
    $checkout_url = $woocommerce->cart->get_checkout_url();
    return $checkout_url;

}

add_filter( 'woocommerce_registration_redirect', 'custom_registration_redirect' );

I tried searching for any plugin which would be overriding this but can't seem to find anything there.

After registration it's going to the My Account page with a _wc_user_reg query string suffixed: /my-account/?_wc_user_reg=true.

It's just not listening to this filter and always going here.

Any idea what is causing this problem?

Thanks.



via Chebli Mohamed

3 commentaires:

  1. Looking for woocommerce Rest API Integration for your online store? Hire our developers & programmers for your custom API and extensions. +91-9806724185 or Contact@expresstechsoftwares.com

    RépondreSupprimer
  2. Nice article. It's very helpful to me. Thank you for share with us. Can you please check my article Display woocommerce registration form fields

    RépondreSupprimer