I am trying to show count for all products "in stock" and also "out of stocks" in sidebar.

I used bellow code but its not working.

$size = $productCollection->getSize();
$itemData[] = [
                'label' => $this->tagFilter->filter($option['label']),
                'value' => $value,
                'count' => $size


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.