简体   繁体   中英

WooCommerce login link on checkout page not linking to correct page (my-account)

The link to the login in the top of screen links to the wrong page. As best as I can surmise the following code is the constructor for the link but I do not understand how to change the link address. Link is pointing at https://whatcomhumane.org/wpwhsnew/checkout/# and I would like it to point at http://whatcomhumane.org/wpwhsnew/my-account .

do_action( 'woocommerce_before_checkout_form', $checkout );

this is the code following above action:

// If checkout registration is disabled and not logged in, the user cannot checkout
if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) {
    echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) );
    return;
}

// filter hook for include new pages inside the payment method
$get_checkout_url = apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_checkout_url() ); ?>

I have used notepad++ to search recursively websites home directory for terms woocommerce_before_checkout_form and $checkout but unable to find where action or variable are defined, looked in functions file in theme,T no joy. Any direction on how to resolve and manipulate the link destination will be greatly appreciated.

在结帐标签的woocommerce设置中,您可以检查页面是否指向您的结帐页面。

Well the /# is actually correct since the appropriate behaviour is for the page to load with the login fields hidden, on click the class of login changes the style from display none to display block.Pretty sure this little batch of code is the js driving action.

    var wc_checkout_login_form = {
    init: function() {
        $( 'body' ).on( 'click', 'a.showlogin', this.show_login_form );
    },
    show_login_form: function( e ) {
        $( 'form.login' ).slideToggle();
        return false;
    }
}

Using my developer tools in chrome and find, helped me identify where my movers and shakers (functions and methods) were in the code structure.Yet this needed no manipulation.

Ends up I had various versions of WooCommerce in my install and just needed to ftp into site and replace the WooCommerce plugin folder with the most current version. Easy peasy but I wonder why my woo updater was not showing I needed to update to 2.3.5? Any how it works as per specs now and on to the next requirement.Also Caleb at WooThemes was very helpful and patient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM