简体   繁体   English

结帐页面上的WooCommerce登录链接未链接到正确的页面(我的帐户)

[英]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 . 链接指向https://whatcomhumane.org/wpwhsnew/checkout/# ,我希望它指向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. 我已经使用notepad ++递归搜索网站主目录中的woocommerce_before_checkout_form和$ checkout术语,但是无法找到定义动作或变量的位置,因此在主题的功能文件中查找时,请不要高兴。 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. /#实际上是正确的,因为适当的行为是页面加载时隐藏了登录字段,单击登录类将样式从显示无更改为显示块。请确保这小部分代码是js驱动的行动。

    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. 在chrome中使用我的开发人员工具进行查找,可以帮助我确定代码结构中的动子和振动器(函数和方法)的位置。但这无需任何操作。

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. 最终,我在安装中安装了各种版本的WooCommerce,只需要通过ftp进入站点并将WooCommerce插件文件夹替换为最新版本即可。 Easy peasy but I wonder why my woo updater was not showing I needed to update to 2.3.5? 很简单,但是我想知道为什么我的woo更新器没有显示我需要更新到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. 无论是现在还是以后的规格,它的工作方式都是如此。WooThemes的Caleb也非常乐于助人和耐心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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