Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiagoebizmarts committed Sep 18, 2017
2 parents 801008e + 34f02a1 commit dfdc4ed
Show file tree
Hide file tree
Showing 30 changed files with 1,540 additions and 330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,40 @@ class Ebizmarts_MailChimp_Block_Adminhtml_Sales_Order_View_Info_Monkey extends M
{
public function isReferred()
{
$order = Mage::registry('current_order');
$order = $this->getCurrentOrder();
$ret = false;
if ($order->getMailchimpAbandonedcartFlag() || $order->getMailchimpCampaignId()) {
$ret = true;
}

return $ret;
}
public function getCampaign()

public function getCampaignId()
{
$order = Mage::registry('current_order');
$order = $this->getCurrentOrder();
return $order->getMailchimpCampaignId();
}

public function addCampaignName()
{
$helper = $this->getMailChimpHelper();
$campaignId = $this->getCampaignId();
$order = $this->getCurrentOrder();
$campaignName = $helper->getMailChimpCampaignNameById($campaignId, $order->getStoreId());
return $campaignName;
}

protected function getMailChimpHelper()
{
return Mage::helper('mailchimp');
}

/**
* @return mixed
*/
protected function getCurrentOrder()
{
return Mage::registry('current_order');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* mc-magento Magento Component
*
* @category Ebizmarts
* @package mc-magento
* @author Ebizmarts Team <[email protected]>
* @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:16 PM
* @file: ResendEcommerceData.php
*/
class Ebizmarts_MailChimp_Block_Adminhtml_System_Config_ResendEcommerceData
extends Mage_Adminhtml_Block_System_Config_Form_Field
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('ebizmarts/mailchimp/system/config/resendecommercedata.phtml');
}

protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
return $this->_toHtml();
}

public function getButtonHtml()
{
$scopeArray = explode('-', Mage::helper('mailchimp')->getScopeString());
if (Mage::helper('mailchimp')->getIfConfigExistsForScope(Ebizmarts_MailChimp_Model_Config::GENERAL_MCSTOREID, $scopeArray[1], $scopeArray[0])) {
$label = $this->helper('mailchimp')->__('Resend Ecommerce Data');
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
'id' => 'resendecommercedata_button',
'label' => $label,
'onclick' => 'javascript:resendecommerce(); return false;',
'title' => $this->helper('mailchimp')->__('Resend Ecommerce Data current scope')
)
);

return $button->toHtml();
}
}

/**
* @return string
*/
public function getMessage()
{
$message = 'Are you sure you want to delete the local data in order to send all items again?\nAutomations will work normally but the synchronization process for the old data will take longer than resetting the MailChimp store.';
return $this->helper('mailchimp')->__($message);
}

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getButtonHtml()
{
$scopeArray = explode('-', Mage::helper('mailchimp')->getScopeString());
if (Mage::helper('mailchimp')->getIfConfigExistsForScope(Ebizmarts_MailChimp_Model_Config::GENERAL_MCSTOREID, $scopeArray[1], $scopeArray[0])) {
$label = $this->helper('mailchimp')->__('Reset Ecommerce Data');
$label = $this->helper('mailchimp')->__('Reset MailChimp Store');
$button = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(
array(
Expand Down
Loading

0 comments on commit dfdc4ed

Please sign in to comment.