public function aroundGetResultCount(Result $resultBlock, \Closure $proceed) { if ($this->resultCount === null) { $size = $this->getProductCollection()->getSize(); $this->resultCount = $size; } return $this->resultCount; }