Model/Apiconnector/ContactData.php
public function getLastCategoryPur()
    {
        $lastOrderId = $this->model->getLastOrderId();
        $order = $this->orderFactory->create();
        $this->orderResource->load($order, $lastOrderId);
        $categoryIds = $this->getCategoriesFromOrderItems($order->getAllItems());

        return $this->getCategoryNames($categoryIds);
    }
public function getLastCategoryPur()
    {
        $lastOrderId = $this->model->getLastOrderId();
        $order = $this->orderFactory->create();
        $this->orderResource->load($order, $lastOrderId);
        $categoryIds = $this->getCategoriesFromOrderItems($order->getAllItems());

        return $this->getCategoryNames($categoryIds);
    }
public function getLastCategoryPur ( ) { $ lastOrderId = $ this -> model -> getLastOrderId ( ) ; $ order = $ this -> orderFactory -> create ( ) ; $ this -> orderResource -> load ( $ order , $ lastOrderId ) ; $ categoryIds = $ this -> getCategoriesFromOrderItems ( $ order -> getAllItems ( ) ) ; return $ this -> getCategoryNames ( $ categoryIds ) ; }
Get last purchased category.

@return string
Get last purchased category .