/** * Check is product assigned to category * * @param int $productId * @param string $categoryPath * @return bool */ protected function _isProductAssignedToCategory($productId, $categoryPath) { return empty($categoryPath) || $this->_productResource->getCountProductCategoriesByRewrite($productId, $categoryPath, $this->_prevStoreId); }