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(); Apr 18 '17 at 7:13
2

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, privacy policy and cookie policy

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