Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
closes #32, closes #4, closes #48, closes #42
  • Loading branch information
Santiagoebizmarts committed Aug 17, 2016
2 parents ef7e85e + bf776f1 commit 7c84e4a
Show file tree
Hide file tree
Showing 43 changed files with 1,948 additions and 435 deletions.
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
$html = '<ul class="checkboxes">';

foreach ($values as $dat) {
if($dat['value'] == 6){
if($dat['value'] == 7){
$html .= "<li style='color:red;font-weight: bold;'>{$dat['label']}</li>";
}else {
$html .= "<li>{$dat['label']}</li>";
Expand Down
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);
}
}
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;
}
}
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));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ protected function _handleCookie(){
$cookieValues = explode('/', $emailCookie);
$email = $cookieValues[0];
$email = str_replace(' ', '+', $email);
$fName = $cookieValues[1];
$lName = $cookieValues[2];
if(isset($cookieValues[1])) {
$fName = $cookieValues[1];
}
if(isset($cookieValues[2])) {
$lName = $cookieValues[2];
}
if($subscribeCookie == 'true'){
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
if(!$subscriber->getId()) {
Expand Down
Loading

0 comments on commit 7c84e4a

Please sign in to comment.