Skip to main content
4 of 4
edited title
Hitesh Balpande
  • 1.9k
  • 2
  • 27
  • 72

is it possible to filter checkout cart collection magento 2?

Actually i want to filter the checkout cart collection using custom attributes values using this link

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$quoteId = $objectManager-> create(‘Magento\Checkout\Model\Session’)->getQuoteId();
$cartData = $objectManager->create(‘Magento\Quote\Model\QuoteRepository’)->get($quoteId)->getAllVisibleItems(); 
$currentItemCount = count($cartData); //Current cart quote count echo $currentItemCount;
Hitesh Balpande
  • 1.9k
  • 2
  • 27
  • 72