警告:WC_MEMBERATIONS_MEMBER_DISPTIONS缺少参数2

时间:2016-11-09 作者:Rangga Setiaga

如何应对“警告:缺少WC\\u Memberships\\u Memberships\\u折扣的参数2”起初我只安装了一种发货方法,然后我尝试购物,出现了错误。但在恢复“下单”成功预订时。

Warning: Missing argument 2

以下代码行中存在问题:

    public function refresh_cart_upon_member_login( $user_login, $user ) {

    // small "hack" to trigger a refresh in cart contents
    // that will set any membership discounts to products that apply
    if ( $user_login && wc_memberships_is_user_active_member( $user, null, false ) ) {

        $this->reset_cart_session_data();
    }
}
以下php代码http://pastebin.com/mcHYTd27 (见第1309行)

请帮帮我谢谢^_^

1 个回复
SO网友:Sumesh S

请检查此链接:https://docs.woocommerce.com/document/woocommerce-memberships-function-reference/#wc_memberships_is_user_active_member

功能wc_memberships_is_user_active_member 只接受两个参数。

我认为您应该根据上面链接中提供的描述修改此代码,以克服此问题warning.