Skip to content

Commit

Permalink
Merge pull request #1838 from mailchimp/Issue1834-2.3.6-p1
Browse files Browse the repository at this point in the history
Issue1834 2.3.6 p1
  • Loading branch information
gonzaloebiz authored Sep 14, 2023
2 parents 93147bb + 459f551 commit 5179a38
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Ui/Component/Batch/Grid/Column/Batches.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Batches extends Column
*/
protected $urlBuilder;
/**
* @var Helper
* @var \Ebizmarts\MailChimp\Model\MailChimpSyncBatches
*/
protected $mailChimpSyncB;
/**
* @var Helper
* @var \Ebizmarts\MailChimp\Helper\Data
*/
protected $helper;

Expand All @@ -53,7 +53,7 @@ public function __construct(
array $components = [],
array $data = []
) {
$this->_helper = $helper;
$this->helper = $helper;
$this->mailChimpSyncB = $mailChimpSyncB;
$this->urlBuilder = $urlBuilder;
parent::__construct($context, $uiComponentFactory, $components, $data);
Expand Down Expand Up @@ -96,9 +96,13 @@ public function prepareDataSource(array $dataSource)
private function getMCStoreNameById($mailchimp_store_id, $magentoStoreId)
{
if (!key_exists($mailchimp_store_id, $this->stores)) {
$api = $this->_helper->getApi($magentoStoreId);
$store = $api->ecommerce->stores->get($mailchimp_store_id);
$this->stores[$mailchimp_store_id] = $store['name'];
$api = $this->helper->getApi($magentoStoreId);
try {
$store = $api->ecommerce->stores->get($mailchimp_store_id);
$this->stores[$mailchimp_store_id] = $store['name'];
} catch (\Exception $e) {
$this->stores[$mailchimp_store_id] = 'Not existing store';
}
}
return $this->stores[$mailchimp_store_id];
}
Expand Down

0 comments on commit 5179a38

Please sign in to comment.