Skip to content

Commit 4a4b4dd

Browse files
authored
Commerce extension automatically available if selected store has a Commerce Partner Integration ID (#464)
1 parent 0cdfc15 commit 4a4b4dd

File tree

1 file changed

+6
-3
lines changed
  • app/code/Meta/BusinessExtension/Block/Adminhtml

1 file changed

+6
-3
lines changed

app/code/Meta/BusinessExtension/Block/Adminhtml/Setup.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ public function fetchPixelId($storeId)
194194
*/
195195
public function isCommerceExtensionEnabled()
196196
{
197-
return $this->systemConfig->isCommerceExtensionEnabled();
197+
$storeID = $this->getSelectedStoreId();
198+
$storeHasCommercePartnerIntegration = !!$this->systemConfig->getCommercePartnerIntegrationId($storeID);
199+
return $storeHasCommercePartnerIntegration || $this->systemConfig->isCommerceExtensionEnabled();
198200
}
199201

200202
/**
@@ -227,13 +229,14 @@ public function getPopupOrigin()
227229
*
228230
* @return string
229231
*/
230-
public function getSplashPageURL() {
232+
public function getSplashPageURL()
233+
{
231234
if (!$this->systemConfig->isCommerceExtensionSplashEnabled()) {
232235
return 'https://business.facebook.com/fbe-iframe-get-started/?';
233236
}
234237

235238
$base_url = $this->systemConfig->getCommerceExtensionBaseURL();
236-
return $base_url.'commerce_extension/splash/?';
239+
return $base_url . 'commerce_extension/splash/?';
237240
}
238241

239242
/**

0 commit comments

Comments
 (0)