in Model/Feed/CategoryCollection.php [280:312]
public function pushNewCategoryToFB(Category $category)
{
$this->fbeHelper->log("pushing category to fb collections: ".$category->getName());
$access_token = $this->fbeHelper->getAccessToken();
if ($access_token == null) {
$this->fbeHelper->log("can't find access token, won't push new catalog category ");
return;
}
$response = null;
try {
$url = $this->getCategoryCreateApi();
if ($url == null) {
return;
}
$params = [
'access_token' => $access_token,
'name' => $this->getCategoryPathName($category),
'filter' => $this->getCategoryProductFilter($category),
];
$this->curl->post($url, $params);
$response = $this->curl->getBody();
} catch (\Exception $e) {
$this->fbeHelper->logException($e);
}
$this->fbeHelper->log("response from fb: ".$response);
$response_obj = json_decode($response, true);
if (array_key_exists('id', $response_obj)) {
$set_id = $response_obj['id'];
$this->saveFBProductSetID($category, $set_id);
$this->fbeHelper->log(sprintf("saving category %s and set_id %s", $category->getName(), $set_id));
}
return $response;
}