Improve get_customer_unique_id()

This commit is contained in:
Claudio Sanches 2021-03-30 14:53:37 -03:00
parent 2da3a37450
commit f913dc09dd
1 changed files with 2 additions and 4 deletions

View File

@ -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();
}