modules/acm_cart/src/CartStorage.php
protected function getCustomerId() {
    $customer_id = NULL;
    $current_user = $this->getCurrentUser();

    if ($current_user->isAnonymous()) {
      return $customer_id;
    }

    $use_ecomm_sessions = \Drupal::config('acm.commerce_users')
      ->get('use_ecomm_sessions');

    if ($use_ecomm_sessions) {
      $customer_id = $current_user->getAccount()->id();
    }
    else {
      $customer_id = $current_user->getAccount()->acm_customer_id;
    }

    return $customer_id;
  }
protected function getCustomerId() {
    $customer_id = NULL;
    $current_user = $this->getCurrentUser();

    if ($current_user->isAnonymous()) {
      return $customer_id;
    }

    $use_ecomm_sessions = \Drupal::config('acm.commerce_users')
      ->get('use_ecomm_sessions');

    if ($use_ecomm_sessions) {
      $customer_id = $current_user->getAccount()->id();
    }
    else {
      $customer_id = $current_user->getAccount()->acm_customer_id;
    }

    return $customer_id;
  }
protected function getCustomerId ( ) { $ customer_id = NULL ; $ current_user = $ this -> getCurrentUser ( ) ; if ( $ current_user -> isAnonymous ( ) ) { return $ customer_id ; } $ use_ecomm_sessions = \ Drupal :: config ( 'acm.commerce_users' ) -> get ( 'use_ecomm_sessions' ) ; if ( $ use_ecomm_sessions ) { $ customer_id = $ current_user -> getAccount ( ) -> id ( ) ; } else { $ customer_id = $ current_user -> getAccount ( ) -> acm_customer_id ; } return $ customer_id ; }
Gets the current customer user id.

@return null|int|string
The current customer id. NULL for none, int for Magento, string for
Hybris.
Gets the current customer user id .