Skip to content

Commit

Permalink
Merge pull request #869 from mailchimp/Issue666-2.3
Browse files Browse the repository at this point in the history
clsoes #866 for magento 2.3
  • Loading branch information
gonzaloebiz authored Sep 4, 2019
2 parents 24f964c + 19f7b49 commit 9894046
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions Block/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Success extends \Magento\Framework\View\Element\Template
* @var \Ebizmarts\MailChimp\Model\MailChimpInterestGroupFactory
*/
protected $_interestGroupFactory;
/**
* @var \Magento\Framework\View\Element\Template\Context
*/
protected $_context;

/**
* Success constructor.
Expand All @@ -54,6 +58,7 @@ public function __construct(
$this->_helper = $helper;
$this->_subscriberFactory = $subscriberFactory;
$this->_interestGroupFactory= $interestGroupFactory;
$this->_context = $context;
}

public function getInterest()
Expand Down Expand Up @@ -88,4 +93,11 @@ public function getFormUrl()
$order = $this->_checkoutSession->getLastRealOrder();
return $this->_helper->getSuccessInterestUrl($order->getStoreId());
}
public function _toHtml()
{
if (!$this->_helper->isMailChimpEnabled($this->_context->getStoreManager()->getStore()->getId())) {
return "";
}
return parent::_toHtml();
}
}
2 changes: 1 addition & 1 deletion view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="head.additional">
<block class="Ebizmarts\MailChimp\Block\Mailchimpjs" name="mailchimp.block.mcjs" template="Ebizmarts_MailChimp::mailchimpjs.phtml"/>
<block class="Ebizmarts\MailChimp\Block\Mailchimpjs" name="mailchimp.block.mcjs" template="Ebizmarts_MailChimp::mailchimpjs.phtml" ifconfig="mailchimp/general/active"/>
</referenceBlock>
<referenceContainer name="content">
<block class="Ebizmarts\MailChimp\Block\Catcher" name="mailchimp.block.catcher" template="Ebizmarts_MailChimp::catcher.phtml" ifconfig="mailchimp/general/active"/>
Expand Down
2 changes: 1 addition & 1 deletion view/frontend/layout/mailchimp_cart_loadquote.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Ebizmarts\MailChimp\Block\Loadquote" name="mailchimp.loadquote" />
<block class="Ebizmarts\MailChimp\Block\Loadquote" name="mailchimp.loadquote" ifconfig="mailchimp/general/active"/>
</referenceContainer>
</body>
</page>
2 changes: 1 addition & 1 deletion view/frontend/layout/newsletter_manage_index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="customer_newsletter">
<block class="Ebizmarts\MailChimp\Block\Newsletter" name="customer.form.newsletter.extra" template="form/newsletter.phtml"/>
<block class="Ebizmarts\MailChimp\Block\Newsletter" name="customer.form.newsletter.extra" template="form/newsletter.phtml" ifconfig="mailchimp/general/active"/>
</referenceBlock>
</body>
</page>

0 comments on commit 9894046

Please sign in to comment.