-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b357bf
commit ebe309e
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* Ebizmarts_MailChimp Magento JS component | ||
* | ||
* @category Ebizmarts | ||
* @package Ebizmarts_MailChimp | ||
* @author Ebizmarts Team <info@ebizmarts.com> | ||
* @copyright Ebizmarts (http://ebizmarts.com) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
namespace Ebizmarts\MailChimp\Block\Adminhtml\System\Config; | ||
|
||
class CreateAbandonedCart extends \Magento\Config\Block\System\Config\Form\Field | ||
{ | ||
protected $_template = 'system/config/create_abandonedcart_automation.phtml'; | ||
|
||
private $_url = "https://admin.mailchimp.com/#/create-campaign/explore/abandonedCart"; | ||
|
||
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) | ||
{ | ||
$originalData = $element->getOriginalData(); | ||
|
||
$label = $originalData['button_label']; | ||
|
||
$this->addData([ | ||
'button_label' => __($label), | ||
'button_url' => $this->authorizeRequestUrl(), | ||
'html_id' => $element->getHtmlId(), | ||
]); | ||
return parent::_toHtml(); | ||
; | ||
} | ||
public function authorizeRequestUrl() | ||
{ | ||
return $this->_url; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
view/adminhtml/templates/system/config/create_abandonedcart_automation.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div class="actions actions-get-apikey"> | ||
<button onclick="javascript:window.open('<?php echo $this->authorizeRequestUrl() ?>', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=800, height=600'); return false;" class="action-get-apikey" type="button" id="<?php echo $block->getHtmlId() ?>"> | ||
<span><?php echo $block->escapeHtml($block->getButtonLabel()) ?></span> | ||
</button> | ||
</div> |