Improve get_customer_unique_id()
This commit is contained in:
parent
2da3a37450
commit
f913dc09dd
|
@ -195,11 +195,9 @@ class WC_Session_Handler extends WC_Session {
|
|||
* @return string
|
||||
*/
|
||||
public function get_customer_unique_id() {
|
||||
$customer_id = '';
|
||||
$customer_id = $this->has_session() && $this->_customer_id ? $this->_customer_id : '';
|
||||
|
||||
if ( $this->has_session() && $this->_customer_id ) {
|
||||
$customer_id = $this->_customer_id;
|
||||
} elseif ( is_user_logged_in() ) {
|
||||
if ( is_user_logged_in() ) {
|
||||
$customer_id = (string) get_current_user_id();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue