How could I show the number of distinct products (not just the number of cart items) in mini cart?
A sample cart table:
product price quantity
aaa 25 2
bbb 35 3
cccc 55 9
Here's what I have tried:
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
$product_id = array();
$product_id = $cart_item['product_id'];
echo count($product_id, COUNT_RECURSIVE);
}