Skip to content

How to get a list of unique cart products

for example i use code for my custome shipping method

    $totalItems = $cart->getQuote()->$getItemsQty();

Total count of products (example add 2 bags adidas and 1 top nike = total 3 items)

But how to get unique items? (example add 2 bags adidas and 1 top nike = total 2 items)