In the past, to load a quote by id, i used to use the factory:
protected $quoteFactory;
public function __construct(
...
MagentoQuoteModelQuoteFactory $quoteFactory,
....
) {
....
$this->quoteFactory = $quoteFactory;
....
}
But since moving on, it is more recommended to use the service contract:
protected $cartRepository;
public function __construct(
...
MagentoQuoteApiCartRepositoryInterface $cartRepository,
....
) {
....
$this->quoteRepository = $cartRepository;
....
}
However this will give me a Cart API, and some of the functions available in Quote like getAllItems
i cannot use via the Cart service, the function getItems
only lists visible ones (meaning it will exclude children items of a configurable item). Is this designed to be this way in order to restrict bad practices or how can i retrieve a quote using the quote_id or the Cart service?