Model/Apiconnector/ContactData.php
public function getMostPurCategory()
    {
        $categories = '';
        $productId = $this->model->getProductIdForMostSoldProduct();
        //sales data found for customer with product id
        if ($productId) {
            $product = $this->getProduct($productId);
            //product found
            if ($product->getId()) {
                $categoryIds = $product->getCategoryIds();
                if (count($categoryIds)) {
                    $categories = $this->getCategoryNames($categoryIds);
                }
            }
        }

        return $categories;
    }
public function getMostPurCategory()
    {
        $categories = '';
        $productId = $this->model->getProductIdForMostSoldProduct();
        //sales data found for customer with product id
        if ($productId) {
            $product = $this->getProduct($productId);
            //product found
            if ($product->getId()) {
                $categoryIds = $product->getCategoryIds();
                if (count($categoryIds)) {
                    $categories = $this->getCategoryNames($categoryIds);
                }
            }
        }

        return $categories;
    }
public function getMostPurCategory ( ) { $ categories = '' ; $ productId = $ this -> model -> getProductIdForMostSoldProduct ( ) ; //sales data found for customer with product id if ( $ productId ) { $ product = $ this -> getProduct ( $ productId ) ; //product found if ( $ product -> getId ( ) ) { $ categoryIds = $ product -> getCategoryIds ( ) ; if ( count ( $ categoryIds ) ) { $ categories = $ this -> getCategoryNames ( $ categoryIds ) ; } } } return $ categories ; }
Get most purchased category.

@return string
Get most purchased category .