Skip to content

Commit

Permalink
Merge pull request #744 from mailchimp/hint-2.2
Browse files Browse the repository at this point in the history
add contribute for magento 2.2
  • Loading branch information
gonzaloebiz authored Jun 3, 2019
2 parents 295ad91 + c14e82a commit 05ba7b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Block/Adminhtml/System/Config/Fieldset/Hint.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ class Hint extends \Magento\Backend\Block\Template implements \Magento\Framework
* @var \Magento\Framework\App\ProductMetadataInterface
*/
private $_metaData;

/**
* @var \Ebizmarts\MailChimp\Helper\Data
*/
private $_helper;
/**
* @var \Magento\Backend\Block\Template\Context
*/
private $_context;

/**
* @param \Magento\Backend\Block\Template\Context $context
Expand All @@ -39,6 +45,7 @@ public function __construct(
parent::__construct($context, $data);
$this->_metaData = $productMetaData;
$this->_helper = $helper;
$this->_context = $context;
}
/**
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
Expand Down Expand Up @@ -71,4 +78,13 @@ public function getModuleVersion()
{
return $this->_helper->getModuleVersion();
}
public function getHasApiKey() {
$apikey = $this->_helper->getApiKey($this->_context->getStoreManager()->getStore()->getId());
if ($apikey) {
return true;
} else {
return false;
}

}
}
3 changes: 3 additions & 0 deletions view/adminhtml/templates/system/config/fieldset/hint.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<p> <strong style="color:#EA7601;"><?php echo __('Mailchimp v') ?><?php echo $this->getModuleVersion() ?><?php echo __(' by') ?></strong> <a target="_blank" href="http://ebizmarts.com"><strong>ebizmarts</strong></a></p>
<p><?php echo __('Need help? See our ') ?><a href="http://wiki.ebizmarts.com/installation" target="_blank"><?php echo __('Wiki') ?></a><?php echo __(' or browse our ') ?><a href="http://ebizmarts.com/forums" target="_blank"><?php echo __('support forums') ?></a><?php echo __(' Got feedback? ') ?><a href="mailto:[email protected]?Subject=MailChimp For Magento Version <?php echo $this->getModuleVersion()?>"><?php echo __('Email us') ?></a></p>
<p><?php echo __('You can find more extension in our ') ?><a href="http://store.ebizmarts.com" target="_blank"><?php echo __('Store') ?></a></p>
<?php if (!$this->getHasApiKey() ) : ?>
<p><a style="padding-top: 5px;padding-bottom:5px;padding-left: 30px;padding-right: 30px;background-color:#D75F07 ;color:white;font-weight: bold" href="http://www.mailchimp.com/signup?pid=ebizmarts&source=website" target="_blank">Support Mailchimp4Magento, Subscribe for a free MailChimp Account!</a> </p>
<?php endif; ?>
</div>
</h4>
</div>

0 comments on commit 05ba7b1

Please sign in to comment.