Skip to content

Commit 957355c

Browse files
authored
When successfully fetched MBE config for a specific store, also update the installed flag. (#798)
1 parent ab4bbac commit 957355c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

app/code/Meta/BusinessExtension/Model/MBEInstalls.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function save($response, $storeId)
152152
$this->saveCommercePartnerIntegrationId($commercePartnerIntegrationId, $storeId);
153153
$this->saveMerchantSettingsId($data['commerce_merchant_settings_id'] ?? '', $storeId);
154154
$this->saveInstalledFeatures($data['installed_features'] ?? '', $storeId);
155+
$this->setInstalledFlag($storeId);
155156
$this->systemConfig->cleanCache();
156157
return true;
157158
}
@@ -309,6 +310,21 @@ private function saveInstalledFeatures($data, $storeId)
309310
$this->fbeHelper->log("Saved fbe_installs 'installed_features' for storeId: {$storeId}");
310311
}
311312

313+
/**
314+
* Update install flag to true and save
315+
*
316+
* @param int $storeId
317+
*/
318+
public function setInstalledFlag($storeId)
319+
{
320+
// set installed to true
321+
$this->systemConfig->saveConfig(
322+
SystemConfig::XML_PATH_FACEBOOK_BUSINESS_EXTENSION_INSTALLED,
323+
true,
324+
$storeId,
325+
);
326+
}
327+
312328
/**
313329
* Update MBE settings through the 'fbe_installs' API
314330
*

0 commit comments

Comments
 (0)