Skip to content

Commit

Permalink
Merge develop branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Mar 30, 2017
2 parents 1e24a73 + 811d7ae commit 70b6d38
Show file tree
Hide file tree
Showing 55 changed files with 2,609 additions and 1,521 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Magento Community Edition (1.7 or above) or Magento Enterprise (1.11 or above)

To get a copy of the project up and running on your local machine for development and testing purposes, just clone this repository on your Magento’s root directory and flush the Magento’s cache.

Alternatively, use modman to install this module.

``modman clone https://github.com/mailchimp/mc-magento.git -b 'master'``


## Module Configuriation

To enable MailChimp For Magento:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public function __construct()

protected function _prepareCollection()
{


$collection = Mage::getModel('mailchimp/mailchimperrors')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
Expand Down Expand Up @@ -68,6 +66,13 @@ protected function _prepareColumns()
'sortable' => true
)
);
$this->addColumn(
'store_id', array(
'header' => Mage::helper('mailchimp')->__('Store Id'),
'index' => 'store_id',
'sortable' => false
)
);
$this->addColumn(
'errors', array(
'header' => Mage::helper('mailchimp')->__('Error'),
Expand All @@ -89,12 +94,12 @@ protected function _prepareColumns()
'sortable' => false,
'filter' => false,
'type' => 'action',
'getter' => 'getBatchId',
'getter' => 'getId',
'actions' => array(
array(
'url' => array('base'=> '*/*/downloadresponse'),
'caption' => $this->helper('mailchimp')->__('Download'),
'field' => 'batch_id'
'field' => 'id'
),
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ protected function _prepareForm()
$fieldset->addField(
'mergevar_label', 'text', array(
'name' => 'mergevar[label]',
'label' => Mage::helper('mailchimp')->__('MergeVar Name'),
'label' => Mage::helper('mailchimp')->__('Merge Field Name'),
'id' => 'mergevar_label',
'title' => Mage::helper('mailchimp')->__('MergeVar Name'),
'title' => Mage::helper('mailchimp')->__('Merge Field Name'),
'required' => true
)
);
$fieldset->addField(
'mergevar_fieldtype', 'select', array(
'name' => 'mergevar[fieldtype]',
'label' => Mage::helper('mailchimp')->__('Field Type'),
'label' => Mage::helper('mailchimp')->__('Merge Field Type'),
'id' => 'mergevar_fieldtype',
'values' => Mage::getSingleton('mailchimp/system_config_source_fieldtype')->getFieldTypes(),
'required' => true
Expand All @@ -36,10 +36,10 @@ protected function _prepareForm()
$fieldset->addField(
'mergevar_value', 'text', array(
'name' => 'mergevar[value]',
'label' => Mage::helper('mailchimp')->__('Value for case entry'),
'label' => Mage::helper('mailchimp')->__('Merge Field Tag'),
'id' => 'mergevar_value',
'title' => Mage::helper('mailchimp')->__('Value for case entry'),
'note' => 'This value should be added in the case of Data.php file',
'title' => Mage::helper('mailchimp')->__('Merge Field Tag'),
'note' => 'This value will be used when adding the logic in the Observer. Blank spaces are not allowed.',
'required' => true
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
$html = '<ul class="checkboxes">';

foreach ($values as $dat) {
if ($dat['value'] == 7) {
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
Expand Up @@ -39,7 +39,8 @@ public function getButtonHtml()
}
public function getAjaxCheckUrl()
{
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/createMergeFields');
$scopeString = Mage::helper('mailchimp')->getScopeString();
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/createMergeFields', array('scope' => $scopeString));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function __construct()
}
}

$customFieldTypes = unserialize(
Mage::helper('mailchimp')->getConfigValue(Ebizmarts_MailChimp_Model_Config::GENERAL_CUSTOM_MAP_FIELDS)
);
$scopeArray = explode('-', Mage::helper('mailchimp')->getScopeString());
$mapFields = Mage::helper('mailchimp')->getCustomMergeFieldsSerialized($scopeArray[1], $scopeArray[0]);
$customFieldTypes = unserialize($mapFields);
if(is_array($customFieldTypes)) {
foreach ($customFieldTypes as $customFieldType) {
$label = $customFieldType['label'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,36 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)

public function getButtonHtml()
{
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
'id' => 'resetecommercedata_button',
'label' => $this->helper('mailchimp')->__('Reset Ecommerce Data'),
'onclick' => 'javascript:resetecommerce(); return false;'
)
);
$scopeArray = explode('-', Mage::helper('mailchimp')->getScopeString());
if (Mage::helper('mailchimp')->getIfMCStoreIdExistsForScope($scopeArray[1], $scopeArray[0])) {
$label = $this->helper('mailchimp')->__('Reset Ecommerce Data');
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
'id' => 'resetecommercedata_button',
'label' => $label,
'onclick' => 'javascript:resetecommerce(); return false;',
'title' => $this->helper('mailchimp')->__('Re-create MailChimp store for current scope')
)
);

return $button->toHtml();
return $button->toHtml();
}
}

/**
* @return string
*/
public function getMessage()
{
$message = 'Are you sure you want to delete the current MailChimp store for this scope and create a new one?\nAutomations created for this store will need to be re-created.';
return $this->helper('mailchimp')->__($message);
}

public function getAjaxCheckUrl()
{
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/resetEcommerceData');
$scopeString = Mage::helper('mailchimp')->getScopeString();
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/resetEcommerceData', array('scope' => $scopeString));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,25 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)

public function getButtonHtml()
{
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
'id' => 'reseterrors_button',
'label' => $this->helper('mailchimp')->__('Reset Local Errors'),
'onclick' => 'javascript:reseterrors(); return false;'
)
);
$scopeArray = explode('-', Mage::helper('mailchimp')->getScopeString());
if (Mage::helper('mailchimp')->getIfMCStoreIdExistsForScope($scopeArray[1], $scopeArray[0])) {
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
'id' => 'reseterrors_button',
'label' => $this->helper('mailchimp')->__('Reset Local Errors'),
'onclick' => 'javascript:reseterrors(); return false;',
'title' => $this->helper('mailchimp')->__('Reset Local Errors only for current scope')
)
);

return $button->toHtml();
return $button->toHtml();
}
}
public function getAjaxCheckUrl()
{
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/resetLocalErrors');
$scopeString = Mage::helper('mailchimp')->getScopeString();
return Mage::helper('adminhtml')->getUrl('adminhtml/ecommerce/resetLocalErrors', array('scope' => $scopeString));
}

}
Loading

0 comments on commit 70b6d38

Please sign in to comment.