/** * Get category URL * * @param string $storeUrl Store URL * @param string $brandId Products BrandId * @param bool $allProducts All products in category * * @return null|string */ public function getCategoryUrl($storeUrl, $brandId, $allProducts = false) { $response = $this->_getCleanHttpClient($storeUrl)->send(); if ($response->getStatusCode() == Response::STATUS_CODE_200) { $body = $response->getBody(); $parser = new Parser(); $url = $parser->getCategoryPageUrl($body, $this->_convertBrandForUrl($brandId)); if ($url) { return $allProducts ? $this->_getCategoryUrlForViewingAllProducts($url) : $url; } } return null; }