-
Notifications
You must be signed in to change notification settings - Fork 94
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
Showing
43 changed files
with
1,948 additions
and
435 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ode/community/Ebizmarts/MailChimp/Block/Adminhtml/Sales/Order/Grid/Renderer/Abandoned.php
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,27 @@ | ||
<?php | ||
/** | ||
* mc-magento Magento Component | ||
* | ||
* @category Ebizmarts | ||
* @package mc-magento | ||
* @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) | ||
* @date: 7/7/16 1:31 PM | ||
* @file: Abandoned.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_Sales_Order_Grid_Renderer_Abandoned extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract | ||
{ | ||
public function render(Varien_Object $row) | ||
{ | ||
$order = Mage::getModel('sales/order')->load($row->getData('entity_id')); | ||
if($order->getMailchimpAbandonedcartFlag()) | ||
{ | ||
$result = '<img src="' . $this->getSkinUrl("mailchimp/images/logo-freddie-monocolor-200.png") . '" width="40" title="recovered cart by Mailchimp" />'; | ||
} | ||
else { | ||
$result = ''; | ||
} | ||
return $result; | ||
} | ||
} |
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
21 changes: 21 additions & 0 deletions
21
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/Date.php
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,21 @@ | ||
<?php | ||
/** | ||
* mc-magento Magento Component | ||
* | ||
* @category Ebizmarts | ||
* @package mc-magento | ||
* @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) | ||
* @date: 7/5/16 2:19 PM | ||
* @file: Date.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
public function render(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
$element->setFormat(Varien_Date::DATE_INTERNAL_FORMAT); | ||
$element->setImage($this->getSkinUrl('images/grid-cal.gif')); | ||
return parent::render($element); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...code/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/Form/Field/Mapfields.php
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,65 @@ | ||
<?php | ||
|
||
/** | ||
* MailChimp For Magento | ||
* | ||
* @category 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) | ||
* @date: 6/28/16 3:55 PM | ||
* @file: Mapfields.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_Form_Field_Mapfields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract | ||
{ | ||
protected $_customerAttributes; | ||
|
||
public function __construct() | ||
{ | ||
$this->addColumn('mailchimp', array( | ||
'label' => Mage::helper('mailchimp')->__('MailChimp'), | ||
'style' => 'width:120px', | ||
)); | ||
$this->addColumn('magento', array( | ||
'label' => Mage::helper('mailchimp')->__('Customer'), | ||
'style' => 'width:120px', | ||
)); | ||
$this->_addAfter = false; | ||
$this->_addButtonLabel = Mage::helper('mailchimp')->__('Add new field'); | ||
parent::__construct(); | ||
$this->setTemplate('ebizmarts/mailchimp/system/config/form/field/array_dropdown.phtml'); | ||
|
||
$this->_customerAttributes = array(); | ||
$attrSetId = Mage::getResourceModel('eav/entity_attribute_collection') | ||
->setEntityTypeFilter(1) | ||
->addSetInfo() | ||
->getData(); | ||
|
||
foreach ($attrSetId as $option){ | ||
if($option['frontend_label']) { | ||
$this->_customerAttributes[$option['attribute_id']] = $option['frontend_label']; | ||
} | ||
} | ||
ksort($this->_customerAttributes); | ||
} | ||
|
||
protected function _renderCellTemplate($columnName) | ||
{ | ||
if (empty($this->_columns[$columnName])) { | ||
throw new Exception('Wrong column name specified.'); | ||
} | ||
$column = $this->_columns[$columnName]; | ||
$inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']'; | ||
|
||
if ($columnName == 'magento') { | ||
$rendered = '<select name="' . $inputName . '">'; | ||
foreach ($this->_customerAttributes as $att => $name) { | ||
$rendered .= '<option value="' . $att . '">' . $name . '</option>'; | ||
} | ||
$rendered .= '</select>'; | ||
} else { | ||
return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' . ($column['size'] ? 'size="' . $column['size'] . '"' : '') . '/>'; | ||
} | ||
return $rendered; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/code/community/Ebizmarts/MailChimp/Block/Adminhtml/System/Config/ResetList.php
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,52 @@ | ||
<?php | ||
/** | ||
* mc-magento Magento Component | ||
* | ||
* @category Ebizmarts | ||
* @package mc-magento | ||
* @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) | ||
* @date: 5/27/16 1:02 PM | ||
* @file: ResetProducts.php | ||
*/ | ||
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_ResetList | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field | ||
{ | ||
protected function _construct() | ||
{ | ||
parent::_construct(); | ||
$this->setTemplate('ebizmarts/mailchimp/system/config/resetlist.phtml'); | ||
} | ||
|
||
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->_toHtml(); | ||
} | ||
|
||
public function getButtonHtml() | ||
{ | ||
$button = $this->getLayout()->createBlock('adminhtml/widget_button') | ||
->setData(array( | ||
'id' => 'changelist_button', | ||
'label' => $this->helper('mailchimp')->__('Change List'), | ||
'onclick' => 'javascript:resetlist(); return false;', | ||
'style' => 'display:none' | ||
)); | ||
|
||
return $button->toHtml(); | ||
} | ||
public function getAjaxCheckUrl() | ||
{ | ||
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/resetList'); | ||
} | ||
public function getMessage() | ||
{ | ||
return __(Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::WARNING_MESSAGE)); | ||
} | ||
public function getPopupMessage() | ||
{ | ||
return __(Mage::getStoreConfig(Ebizmarts_MailChimp_Model_Config::POPUP_MESSAGE)); | ||
} | ||
|
||
} |
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
Oops, something went wrong.