I know product sku's can be fetched using the quote object and a foreach loop

foreach($this->getOnepage()->getQuote()->getAllItems() as $item){
    $sku = $item->getSku();
    $_SKU = $item->getProduct()->getSku(); // or this way

but I want to know whether there is any other short and crisp way to do this? I mean without using foreach loop, i.e. a inbuilt function returning an array of product data in the quote.


This snippet returns array of quote items sku


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.