0

I have my Quote object, I just want to fetch customer id from it.

Here is how I loaded the quote object,

protected $quoteRepository;

public function __construct(
    ...
    \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
    ....
) {
    ....
    $this->quoteRepository = $quoteRepository;
    ....
}

$quote = $this->quoteRepository->get($quoteId);
1
  • 1
    Just $quote->getCustomerId(); Commented Apr 18, 2017 at 7:13

1 Answer 1

4

You can get the customer Id as follows.

$customerId = $quote->getCustomer()->getId();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.