Version Notes
Configurable, Grouped and Bundle Product improvements.
Related Products Improvements.
Updates for custom checkouts.
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | EmailDirect_Integration |
| Version | 2.0.3 |
| Comparing to | |
| See all releases | |
Code changes from version 2.0.2 to 2.0.3
- app/code/community/EmailDirect/Integration/Helper/Data.php +40 -8
- app/code/community/EmailDirect/Integration/Helper/Fields.php +7 -0
- app/code/community/EmailDirect/Integration/Model/Observer.php +376 -67
- app/code/community/EmailDirect/Integration/Model/Wrapper/Orders.php +16 -1
- app/code/community/EmailDirect/Integration/Model/Wrapper/Subscribers.php +1 -1
- app/code/community/EmailDirect/Integration/controllers/AbandonedController.php +168 -25
- app/code/community/EmailDirect/Integration/controllers/Admin/ExportController.php +7 -1
- app/code/community/EmailDirect/Integration/etc/config.xml +1 -1
- app/design/adminhtml/default/default/template/emaildirect/system/config/fieldset/hint.phtml +2 -0
- app/design/frontend/base/default/template/emaildirect/checkout/subscribe.phtml +10 -10
- app/design/frontend/base/default/template/emaildirect/customer/account/dashboard/info.phtml +45 -50
- package.xml +8 -6
app/code/community/EmailDirect/Integration/Helper/Data.php
CHANGED
|
@@ -22,6 +22,29 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 22 |
private $_log_area = "";
|
| 23 |
private $_current_store = null;
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
public function getStoreId($code)
|
| 26 |
{
|
| 27 |
if ($code == null)
|
|
@@ -38,9 +61,12 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 38 |
}
|
| 39 |
}
|
| 40 |
|
| 41 |
-
public function setCurrentStore($
|
| 42 |
{
|
| 43 |
-
$this->_current_store = $
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
|
| 46 |
public function getAdminStore()
|
|
@@ -204,18 +230,21 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 204 |
$config->cleanCache();
|
| 205 |
}
|
| 206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
public function getCurrentStore()
|
| 208 |
{
|
| 209 |
$store = Mage::app()->getStore()->getId();
|
| 210 |
-
|
| 211 |
$config_store = Mage::app()->getRequest()->getParam('store');
|
| 212 |
-
|
| 213 |
$on_config = $this->onConfigPage();
|
| 214 |
|
| 215 |
if ($config_store && $on_config)
|
| 216 |
$store = $config_store;
|
| 217 |
-
else if (!is_null($this->_current_store))
|
| 218 |
-
|
| 219 |
|
| 220 |
if (is_string($store))
|
| 221 |
return $this->getStoreId($store);
|
|
@@ -935,6 +964,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 935 |
$date = date("Y-m-d H:i:s", $date);
|
| 936 |
|
| 937 |
$this->updateConfig("start_date",$date,$store,"troubleshooting");
|
|
|
|
| 938 |
}
|
| 939 |
|
| 940 |
public function turnOffTroubleshooting($store = null, $quiet = true)
|
|
@@ -967,14 +997,15 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 967 |
}
|
| 968 |
}
|
| 969 |
|
| 970 |
-
|
|
|
|
|
|
|
| 971 |
if (!$publication_subscribed)
|
| 972 |
{
|
| 973 |
foreach ($data['lists'] as $list_id => $list)
|
| 974 |
{
|
| 975 |
$data['lists'][$list_id]['disabled'] = true;
|
| 976 |
}
|
| 977 |
-
$data['count'] = $pub_count;
|
| 978 |
$data['list_count'] = 0;
|
| 979 |
return $data;
|
| 980 |
}
|
|
@@ -1059,6 +1090,7 @@ class EmailDirect_Integration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 1059 |
{
|
| 1060 |
Mage::logException($e);
|
| 1061 |
$this->logException($e);
|
|
|
|
| 1062 |
return $data;
|
| 1063 |
}
|
| 1064 |
}
|
| 22 |
private $_log_area = "";
|
| 23 |
private $_current_store = null;
|
| 24 |
|
| 25 |
+
// Used to restore configurable products to the cart
|
| 26 |
+
public function getConfigurableOptions($product, $simple_product_id)
|
| 27 |
+
{
|
| 28 |
+
$type_instance = $product->getTypeInstance(true);
|
| 29 |
+
$child_products = $type_instance->getUsedProducts(null, $product);
|
| 30 |
+
$attrbutes = $type_instance->getUsedProductAttributes($product);
|
| 31 |
+
|
| 32 |
+
$super_attrbutes = array();
|
| 33 |
+
|
| 34 |
+
foreach ($child_products as $child)
|
| 35 |
+
{
|
| 36 |
+
if ($child->getId() == $simple_product_id)
|
| 37 |
+
{
|
| 38 |
+
foreach ($attrbutes as $attribute)
|
| 39 |
+
{
|
| 40 |
+
$super_attrbutes[$attribute->getAttributeId()] = $child->getData($attribute->getAttributeCode());
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
return $super_attrbutes;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
public function getStoreId($code)
|
| 49 |
{
|
| 50 |
if ($code == null)
|
| 61 |
}
|
| 62 |
}
|
| 63 |
|
| 64 |
+
public function setCurrentStore($store_code, $set_magento_store = true)
|
| 65 |
{
|
| 66 |
+
$this->_current_store = $store_code;
|
| 67 |
+
|
| 68 |
+
if ($set_magento_store)
|
| 69 |
+
Mage::app()->setCurrentStore($store_code);
|
| 70 |
}
|
| 71 |
|
| 72 |
public function getAdminStore()
|
| 230 |
$config->cleanCache();
|
| 231 |
}
|
| 232 |
|
| 233 |
+
public function resetCurrentStore()
|
| 234 |
+
{
|
| 235 |
+
$this->_current_store = null;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
public function getCurrentStore()
|
| 239 |
{
|
| 240 |
$store = Mage::app()->getStore()->getId();
|
|
|
|
| 241 |
$config_store = Mage::app()->getRequest()->getParam('store');
|
|
|
|
| 242 |
$on_config = $this->onConfigPage();
|
| 243 |
|
| 244 |
if ($config_store && $on_config)
|
| 245 |
$store = $config_store;
|
| 246 |
+
//else if (!is_null($this->_current_store))
|
| 247 |
+
// $store = $this->_current_store;
|
| 248 |
|
| 249 |
if (is_string($store))
|
| 250 |
return $this->getStoreId($store);
|
| 964 |
$date = date("Y-m-d H:i:s", $date);
|
| 965 |
|
| 966 |
$this->updateConfig("start_date",$date,$store,"troubleshooting");
|
| 967 |
+
$this->updateConfig("enabled","1",$store,"troubleshooting");
|
| 968 |
}
|
| 969 |
|
| 970 |
public function turnOffTroubleshooting($store = null, $quiet = true)
|
| 997 |
}
|
| 998 |
}
|
| 999 |
|
| 1000 |
+
$data['count'] = $pub_count;
|
| 1001 |
+
|
| 1002 |
+
// Disable the lists if the publication is not subscribed
|
| 1003 |
if (!$publication_subscribed)
|
| 1004 |
{
|
| 1005 |
foreach ($data['lists'] as $list_id => $list)
|
| 1006 |
{
|
| 1007 |
$data['lists'][$list_id]['disabled'] = true;
|
| 1008 |
}
|
|
|
|
| 1009 |
$data['list_count'] = 0;
|
| 1010 |
return $data;
|
| 1011 |
}
|
| 1090 |
{
|
| 1091 |
Mage::logException($e);
|
| 1092 |
$this->logException($e);
|
| 1093 |
+
$this->resetLogLevel();
|
| 1094 |
return $data;
|
| 1095 |
}
|
| 1096 |
}
|
app/code/community/EmailDirect/Integration/Helper/Fields.php
CHANGED
|
@@ -38,6 +38,13 @@ class EmailDirect_Integration_Helper_Fields extends Mage_Core_Helper_Abstract
|
|
| 38 |
array('name' => "{$prefix}ProductName{$i}",
|
| 39 |
'type' => 'Text',
|
| 40 |
'size' => '200');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
$fields[] =
|
| 42 |
array('name' => "{$prefix}SKU{$i}",
|
| 43 |
'type' => 'Text',
|
| 38 |
array('name' => "{$prefix}ProductName{$i}",
|
| 39 |
'type' => 'Text',
|
| 40 |
'size' => '200');
|
| 41 |
+
|
| 42 |
+
if ($prefix != 'Related')
|
| 43 |
+
$fields[] =
|
| 44 |
+
array('name' => "{$prefix}ParentName{$i}",
|
| 45 |
+
'type' => 'Text',
|
| 46 |
+
'size' => '200');
|
| 47 |
+
|
| 48 |
$fields[] =
|
| 49 |
array('name' => "{$prefix}SKU{$i}",
|
| 50 |
'type' => 'Text',
|
app/code/community/EmailDirect/Integration/Model/Observer.php
CHANGED
|
@@ -240,7 +240,9 @@ class EmailDirect_Integration_Model_Observer
|
|
| 240 |
$this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
|
| 241 |
$store = $this->_helper->getStoreId($observer->getEvent()->getStore());
|
| 242 |
$post = Mage::app()->getRequest()->getPost();
|
| 243 |
-
|
|
|
|
|
|
|
| 244 |
$fields = $post['groups']['general']['fields'];
|
| 245 |
|
| 246 |
$apiKey = isset($fields['apikey']['value']) ? $fields['apikey']['value'] : $this->_helper->config('apikey');
|
|
@@ -277,7 +279,6 @@ class EmailDirect_Integration_Model_Observer
|
|
| 277 |
// Verify all custom fields are present
|
| 278 |
Mage::helper('emaildirect/fields')->verifyFields($force_product);
|
| 279 |
|
| 280 |
-
$this->saveTroubleshooting($store);
|
| 281 |
$this->_helper->resetLogLevel();
|
| 282 |
}
|
| 283 |
|
|
@@ -321,19 +322,68 @@ class EmailDirect_Integration_Model_Observer
|
|
| 321 |
return $merge_vars;
|
| 322 |
}
|
| 323 |
|
| 324 |
-
private function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
{
|
| 326 |
$name = "";
|
|
|
|
| 327 |
$sku = "";
|
| 328 |
$url = "";
|
| 329 |
$image = "";
|
| 330 |
$cost = "";
|
| 331 |
$description = "";
|
|
|
|
| 332 |
|
| 333 |
-
if ($
|
| 334 |
{
|
| 335 |
$product_id = 0;
|
| 336 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
if (is_string($item))
|
| 338 |
$product_id = $item;
|
| 339 |
else
|
|
@@ -347,24 +397,44 @@ class EmailDirect_Integration_Model_Observer
|
|
| 347 |
|
| 348 |
if ($product != null)
|
| 349 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
$name = $product->getName();
|
| 351 |
$sku = $product->getSku();
|
| 352 |
-
$url = $product->getProductUrl();
|
| 353 |
|
| 354 |
if ($product->getImage() != 'no_selection')
|
| 355 |
$image = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
| 356 |
|
| 357 |
if (is_string($item))
|
| 358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
else
|
| 360 |
$cost = $item->getPrice();
|
| 361 |
|
| 362 |
-
$cost = Mage::helper('core')->currency($cost,true,false)
|
| 363 |
$description = $product->getShortDescription();
|
| 364 |
}
|
| 365 |
}
|
| 366 |
|
| 367 |
$merge_vars["{$prefix}ProductName{$pos}"] = $name;
|
|
|
|
|
|
|
|
|
|
| 368 |
$merge_vars["{$prefix}SKU{$pos}"] = $sku;
|
| 369 |
$merge_vars["{$prefix}URL{$pos}"] = $url;
|
| 370 |
$merge_vars["{$prefix}Image{$pos}"] = $image;
|
|
@@ -375,27 +445,94 @@ class EmailDirect_Integration_Model_Observer
|
|
| 375 |
return $merge_vars;
|
| 376 |
}
|
| 377 |
|
| 378 |
-
private function
|
| 379 |
{
|
| 380 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
|
| 382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 383 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
$id_list = array();
|
|
|
|
|
|
|
| 385 |
|
| 386 |
-
foreach($quote->getAllItems() as $item)
|
| 387 |
{
|
| 388 |
-
if (
|
| 389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 390 |
}
|
| 391 |
|
| 392 |
-
$
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 397 |
|
| 398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 399 |
|
| 400 |
$count = 0;
|
| 401 |
|
|
@@ -406,7 +543,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 406 |
if ($count > $max_count)
|
| 407 |
break;
|
| 408 |
|
| 409 |
-
$merge_vars = $this->addMergeItem($rp
|
| 410 |
}
|
| 411 |
|
| 412 |
while ($count < $max_count)
|
|
@@ -418,13 +555,100 @@ class EmailDirect_Integration_Model_Observer
|
|
| 418 |
return $merge_vars;
|
| 419 |
}
|
| 420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
private function getMergeOrderItems($quote, $merge_vars, $prefix = "")
|
| 422 |
{
|
| 423 |
$max_count = $this->_helper->config('product_fields');
|
| 424 |
|
| 425 |
$count = 0;
|
| 426 |
|
| 427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
{
|
| 429 |
$count++;
|
| 430 |
|
|
@@ -464,6 +688,8 @@ class EmailDirect_Integration_Model_Observer
|
|
| 464 |
{
|
| 465 |
try
|
| 466 |
{
|
|
|
|
|
|
|
| 467 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CUSTOMER);
|
| 468 |
|
| 469 |
$customer = $observer->getEvent()->getCustomer();
|
|
@@ -480,7 +706,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 480 |
return $observer;
|
| 481 |
}
|
| 482 |
else
|
| 483 |
-
|
| 484 |
}
|
| 485 |
|
| 486 |
$this->_helper->log("Update Customer Start");
|
|
@@ -488,6 +714,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 488 |
if (!$this->_helper->canEdirect())
|
| 489 |
{
|
| 490 |
$this->_helper->logReason($this->_helper->getDisabledReason());
|
|
|
|
| 491 |
return $observer;
|
| 492 |
}
|
| 493 |
|
|
@@ -534,9 +761,21 @@ class EmailDirect_Integration_Model_Observer
|
|
| 534 |
$this->_helper->logException($e);
|
| 535 |
}
|
| 536 |
|
|
|
|
| 537 |
return $observer;
|
| 538 |
}
|
| 539 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 540 |
public function registerCheckoutSubscribe(Varien_Event_Observer $observer)
|
| 541 |
{
|
| 542 |
try
|
|
@@ -550,7 +789,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 550 |
}
|
| 551 |
$subscribe = Mage::app()->getRequest()->getPost('emaildirect_subscribe');
|
| 552 |
|
| 553 |
-
if(!is_null($subscribe))
|
| 554 |
Mage::getSingleton('core/session')->setEmaildirectCheckout($subscribe);
|
| 555 |
|
| 556 |
$this->_helper->log("Register Checkout Subscribe End");
|
|
@@ -571,7 +810,8 @@ class EmailDirect_Integration_Model_Observer
|
|
| 571 |
{
|
| 572 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::NEWSLETTER);
|
| 573 |
$this->_helper->log("Register Checkout Success Start");
|
| 574 |
-
|
|
|
|
| 575 |
{
|
| 576 |
$this->_helper->logReason($this->_helper->getDisabledReason());
|
| 577 |
return;
|
|
@@ -584,31 +824,31 @@ class EmailDirect_Integration_Model_Observer
|
|
| 584 |
return;
|
| 585 |
}
|
| 586 |
|
| 587 |
-
$
|
| 588 |
|
| 589 |
-
if (!$
|
| 590 |
{
|
| 591 |
$this->_helper->logReason("Order ID not found.");
|
| 592 |
return;
|
| 593 |
}
|
| 594 |
|
| 595 |
-
$order = Mage::getModel('sales/order')->load($
|
| 596 |
if (!$order->getId())
|
| 597 |
{
|
| 598 |
-
$this->_helper->logReason("Failed to Load Order ({$
|
| 599 |
return;
|
| 600 |
}
|
| 601 |
|
| 602 |
$this->_helper->log("Processing Order # " . $order->getIncrementId());
|
| 603 |
|
| 604 |
//Guest Checkout
|
| 605 |
-
if
|
| 606 |
{
|
| 607 |
$this->_helper->log("Guest Checkout");
|
| 608 |
$this->_helper->registerGuestCustomer($order);
|
| 609 |
}
|
| 610 |
|
| 611 |
-
$
|
| 612 |
->subscribe($order->getCustomerEmail());
|
| 613 |
|
| 614 |
$this->_helper->log("Register Checkout Success End");
|
|
@@ -785,22 +1025,20 @@ class EmailDirect_Integration_Model_Observer
|
|
| 785 |
{
|
| 786 |
try
|
| 787 |
{
|
|
|
|
| 788 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
|
| 789 |
$this->_helper->log("Process Batch Orders Start");
|
| 790 |
|
| 791 |
$stores = Mage::app()->getStores();
|
| 792 |
|
| 793 |
-
$starting_store = Mage::app()->getStore()->getCode();
|
| 794 |
-
|
| 795 |
foreach ($stores as $store)
|
| 796 |
{
|
| 797 |
Mage::app()->setCurrentStore($store->getCode());
|
| 798 |
-
$this->_helper->setCurrentStore($store->getId());
|
| 799 |
|
| 800 |
$this->processBatchStoreOrders($store);
|
| 801 |
}
|
| 802 |
|
| 803 |
-
Mage::app()->setCurrentStore(
|
| 804 |
|
| 805 |
$this->_helper->log("Process Batch Orders End");
|
| 806 |
}
|
|
@@ -818,19 +1056,25 @@ class EmailDirect_Integration_Model_Observer
|
|
| 818 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
|
| 819 |
$this->_helper->log("Process Saved Order Start");
|
| 820 |
|
| 821 |
-
$this->_helper->log("Order
|
| 822 |
|
| 823 |
$this->_helper->log("Order Store: " . $order->getStoreId());
|
| 824 |
-
$
|
|
|
|
|
|
|
| 825 |
|
| 826 |
if (!$this->_helper->getOrdersEnabled())
|
| 827 |
{
|
| 828 |
$this->_helper->logReason($this->_helper->getOrdersDisabledReason());
|
|
|
|
| 829 |
return;
|
| 830 |
}
|
| 831 |
|
| 832 |
if (!$this->canSendOrder($order, $batch))
|
|
|
|
|
|
|
| 833 |
return;
|
|
|
|
| 834 |
|
| 835 |
$this->_helper->log("Order is ready to send. Processing...");
|
| 836 |
|
|
@@ -855,7 +1099,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 855 |
$address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
|
| 856 |
$customer->setBillingAddress($address);
|
| 857 |
}
|
| 858 |
-
|
| 859 |
$merge_vars = $this->_helper->getMergeVars($customer, true);
|
| 860 |
$merge_vars = $this->_helper->getOrderMergeVars($merge_vars,$order);
|
| 861 |
|
|
@@ -886,6 +1130,8 @@ class EmailDirect_Integration_Model_Observer
|
|
| 886 |
Mage::logException($e);
|
| 887 |
$this->_helper->logException($e);
|
| 888 |
}
|
|
|
|
|
|
|
| 889 |
}
|
| 890 |
|
| 891 |
public function orderSaveAfter(Varien_Event_Observer $observer)
|
|
@@ -1146,7 +1392,8 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1146 |
{
|
| 1147 |
try
|
| 1148 |
{
|
| 1149 |
-
|
|
|
|
| 1150 |
$this->_helper->log("Manual Abandoned Carts Processor Start");
|
| 1151 |
|
| 1152 |
$check_date = $this->getAbandonedTime();
|
|
@@ -1155,19 +1402,17 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1155 |
|
| 1156 |
$stores = Mage::app()->getStores();
|
| 1157 |
|
| 1158 |
-
$starting_store = Mage::app()->getStore()->getCode();
|
| 1159 |
-
|
| 1160 |
foreach ($stores as $store)
|
| 1161 |
{
|
| 1162 |
if ($store_id == null || $store_id == $store->getId())
|
| 1163 |
{
|
| 1164 |
Mage::app()->setCurrentStore($store->getCode());
|
| 1165 |
-
|
| 1166 |
$this->abandonedStoreProcessor($store, $check_date);
|
| 1167 |
}
|
| 1168 |
}
|
| 1169 |
|
| 1170 |
-
Mage::app()->setCurrentStore(
|
| 1171 |
|
| 1172 |
$this->_helper->log("Manual Abandoned Carts Processor End");
|
| 1173 |
}
|
|
@@ -1182,6 +1427,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1182 |
{
|
| 1183 |
try
|
| 1184 |
{
|
|
|
|
| 1185 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
|
| 1186 |
$this->_helper->log("Abandoned Carts Processor Start");
|
| 1187 |
|
|
@@ -1191,7 +1437,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1191 |
|
| 1192 |
$stores = Mage::app()->getStores();
|
| 1193 |
|
| 1194 |
-
|
| 1195 |
|
| 1196 |
foreach ($stores as $store)
|
| 1197 |
{
|
|
@@ -1200,7 +1446,7 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1200 |
$this->abandonedStoreProcessor($store, $check_date);
|
| 1201 |
}
|
| 1202 |
|
| 1203 |
-
Mage::app()->setCurrentStore(
|
| 1204 |
|
| 1205 |
$date = date(Mage::getModel('core/date')->gmtTimestamp());
|
| 1206 |
$date = date($this->_date_format, $date);
|
|
@@ -1223,6 +1469,8 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1223 |
{
|
| 1224 |
$count = 0;
|
| 1225 |
|
|
|
|
|
|
|
| 1226 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
|
| 1227 |
$this->_helper->log("Sending Specific Abandoned Carts Start");
|
| 1228 |
|
|
@@ -1232,8 +1480,6 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1232 |
|
| 1233 |
$stores = Mage::app()->getStores();
|
| 1234 |
|
| 1235 |
-
$starting_store = Mage::app()->getStore()->getCode();
|
| 1236 |
-
|
| 1237 |
foreach ($stores as $store)
|
| 1238 |
{
|
| 1239 |
$this->_helper->log("Checking for valid carts in store: {$store->getName()} ({$store->getId()})");
|
|
@@ -1254,10 +1500,11 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1254 |
|
| 1255 |
$this->_helper->log("SQL: " . $collection->getSelect()->__toString());
|
| 1256 |
|
|
|
|
| 1257 |
$this->_abandonedCartsProcessor($collection, $store, false);
|
| 1258 |
}
|
| 1259 |
|
| 1260 |
-
Mage::app()->setCurrentStore(
|
| 1261 |
|
| 1262 |
$this->_helper->log("Sending Specific Abandoned Carts End");
|
| 1263 |
|
|
@@ -1267,44 +1514,106 @@ class EmailDirect_Integration_Model_Observer
|
|
| 1267 |
{
|
| 1268 |
Mage::logException($e);
|
| 1269 |
$this->_helper->logException($e);
|
|
|
|
| 1270 |
}
|
| 1271 |
}
|
| 1272 |
-
|
| 1273 |
-
|
| 1274 |
-
// START QUOTE SAVE AFTER
|
| 1275 |
private function getAbandonedUrl($quote)
|
| 1276 |
{
|
| 1277 |
// We are using comma separated lists for the ID's and Quantities so that it takes up less
|
| 1278 |
// space when we generate the Querystring
|
|
|
|
|
|
|
| 1279 |
|
| 1280 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1281 |
$qtys = "";
|
| 1282 |
-
|
| 1283 |
-
|
| 1284 |
-
|
| 1285 |
-
|
| 1286 |
{
|
| 1287 |
$ids .= ",";
|
| 1288 |
$qtys .= ",";
|
| 1289 |
}
|
| 1290 |
-
|
| 1291 |
-
|
| 1292 |
-
|
| 1293 |
-
|
| 1294 |
-
|
| 1295 |
-
|
| 1296 |
-
|
| 1297 |
-
|
| 1298 |
-
|
| 1299 |
-
|
| 1300 |
-
|
|
|
|
|
|
|
|
|
|
| 1301 |
$url = base64_encode(serialize($url_data));
|
| 1302 |
|
| 1303 |
$url = Mage::getUrl('emaildirect/abandoned/restore',array('_secure'=>true)) . "?cart={$url}";
|
| 1304 |
|
| 1305 |
return $url;
|
| 1306 |
}
|
| 1307 |
-
|
|
|
|
|
|
|
| 1308 |
public function quoteSaveAfter(Varien_Event_Observer $observer)
|
| 1309 |
{
|
| 1310 |
try
|
| 240 |
$this->_helper->setLogLevel(EmailDirect_Integration_Helper_Data::LOG_LEVEL_LOW);
|
| 241 |
$store = $this->_helper->getStoreId($observer->getEvent()->getStore());
|
| 242 |
$post = Mage::app()->getRequest()->getPost();
|
| 243 |
+
|
| 244 |
+
$this->saveTroubleshooting($store);
|
| 245 |
+
|
| 246 |
$fields = $post['groups']['general']['fields'];
|
| 247 |
|
| 248 |
$apiKey = isset($fields['apikey']['value']) ? $fields['apikey']['value'] : $this->_helper->config('apikey');
|
| 279 |
// Verify all custom fields are present
|
| 280 |
Mage::helper('emaildirect/fields')->verifyFields($force_product);
|
| 281 |
|
|
|
|
| 282 |
$this->_helper->resetLogLevel();
|
| 283 |
}
|
| 284 |
|
| 322 |
return $merge_vars;
|
| 323 |
}
|
| 324 |
|
| 325 |
+
private function getParentOptions($parent_product,$product_id)
|
| 326 |
+
{
|
| 327 |
+
$parent_options = $this->_helper->getConfigurableOptions($parent_product,$product_id);
|
| 328 |
+
|
| 329 |
+
if (count($parent_options) == 0)
|
| 330 |
+
return "";
|
| 331 |
+
|
| 332 |
+
$options = "";
|
| 333 |
+
|
| 334 |
+
foreach ($parent_options as $key => $value)
|
| 335 |
+
{
|
| 336 |
+
if ($options == "")
|
| 337 |
+
$options .= "#";
|
| 338 |
+
else
|
| 339 |
+
$options .= "&";
|
| 340 |
+
|
| 341 |
+
$options .= "{$key}={$value}";
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
return $options;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
private function getGroupedPrice($grouped_product)
|
| 348 |
+
{
|
| 349 |
+
$min = 0;
|
| 350 |
+
$products = $grouped_product->getTypeInstance()->getAssociatedProducts();
|
| 351 |
+
foreach ($products as $product)
|
| 352 |
+
{
|
| 353 |
+
if ($min == 0)
|
| 354 |
+
$min = $product->getPrice();
|
| 355 |
+
|
| 356 |
+
$min = min($min, $product->getPrice());
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
return $min;
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
private function addMergeItem($item_data, $pos, $merge_vars, $prefix = "")
|
| 363 |
{
|
| 364 |
$name = "";
|
| 365 |
+
$parent_name = "";
|
| 366 |
$sku = "";
|
| 367 |
$url = "";
|
| 368 |
$image = "";
|
| 369 |
$cost = "";
|
| 370 |
$description = "";
|
| 371 |
+
$parent_item = null;
|
| 372 |
|
| 373 |
+
if ($item_data != null)
|
| 374 |
{
|
| 375 |
$product_id = 0;
|
| 376 |
|
| 377 |
+
if (is_array($item_data))
|
| 378 |
+
{
|
| 379 |
+
$item = $item_data['item'];
|
| 380 |
+
|
| 381 |
+
if (isset($item_data['parent']))
|
| 382 |
+
$parent_item = $item_data['parent'];
|
| 383 |
+
}
|
| 384 |
+
else
|
| 385 |
+
$item = $item_data;
|
| 386 |
+
|
| 387 |
if (is_string($item))
|
| 388 |
$product_id = $item;
|
| 389 |
else
|
| 397 |
|
| 398 |
if ($product != null)
|
| 399 |
{
|
| 400 |
+
if ($parent_item != null)
|
| 401 |
+
{
|
| 402 |
+
$parent_product = Mage::getModel('catalog/product')->load($parent_item->getProduct()->getId());
|
| 403 |
+
|
| 404 |
+
$parent_name = $parent_product->getName();
|
| 405 |
+
$url = $parent_product->getProductUrl();
|
| 406 |
+
|
| 407 |
+
if ($parent_product->getTypeId() == 'configurable')
|
| 408 |
+
$url .= $this->getParentOptions($parent_product,$product_id);
|
| 409 |
+
}
|
| 410 |
+
else
|
| 411 |
+
$url = $product->getProductUrl();
|
| 412 |
+
|
| 413 |
$name = $product->getName();
|
| 414 |
$sku = $product->getSku();
|
|
|
|
| 415 |
|
| 416 |
if ($product->getImage() != 'no_selection')
|
| 417 |
$image = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage());
|
| 418 |
|
| 419 |
if (is_string($item))
|
| 420 |
+
{
|
| 421 |
+
if ($product->getTypeId() == 'grouped')
|
| 422 |
+
$cost = $this->getGroupedPrice($product);
|
| 423 |
+
else
|
| 424 |
+
$cost = $product->getPrice();
|
| 425 |
+
}
|
| 426 |
else
|
| 427 |
$cost = $item->getPrice();
|
| 428 |
|
| 429 |
+
$cost = Mage::helper('core')->currency($cost,true,false);
|
| 430 |
$description = $product->getShortDescription();
|
| 431 |
}
|
| 432 |
}
|
| 433 |
|
| 434 |
$merge_vars["{$prefix}ProductName{$pos}"] = $name;
|
| 435 |
+
if ($prefix != 'Related')
|
| 436 |
+
$merge_vars["{$prefix}ParentName{$pos}"] = $parent_name;
|
| 437 |
+
|
| 438 |
$merge_vars["{$prefix}SKU{$pos}"] = $sku;
|
| 439 |
$merge_vars["{$prefix}URL{$pos}"] = $url;
|
| 440 |
$merge_vars["{$prefix}Image{$pos}"] = $image;
|
| 445 |
return $merge_vars;
|
| 446 |
}
|
| 447 |
|
| 448 |
+
private function getRelatedCollection($id_list, $max_count, $grouped_id_list = null)
|
| 449 |
{
|
| 450 |
+
$collection = Mage::getModel('catalog/product_link')
|
| 451 |
+
->useRelatedLinks()
|
| 452 |
+
->getCollection()
|
| 453 |
+
->addFieldToFilter('product_id', array('in' => $id_list))
|
| 454 |
+
;
|
| 455 |
|
| 456 |
+
// Filter on grouped products as well
|
| 457 |
+
if ($grouped_id_list != null)
|
| 458 |
+
$id_list = array_merge($id_list,$grouped_id_list);
|
| 459 |
+
|
| 460 |
+
$product_ids = array();
|
| 461 |
+
|
| 462 |
+
foreach ($collection as $rp)
|
| 463 |
+
{
|
| 464 |
+
$lp_id = $rp['linked_product_id'];
|
| 465 |
+
if (!in_array($lp_id,$id_list))
|
| 466 |
+
$product_ids[] = $lp_id;
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
$related = Mage::getResourceModel('catalog/product_collection')
|
| 470 |
+
->addFieldToFilter('entity_id', array('in' => $product_ids))
|
| 471 |
+
->setPageSize($max_count);
|
| 472 |
+
|
| 473 |
+
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($related);
|
| 474 |
+
|
| 475 |
+
$related_list = array();
|
| 476 |
|
| 477 |
+
if (count($related) > 0)
|
| 478 |
+
{
|
| 479 |
+
foreach ($related as $rp)
|
| 480 |
+
{
|
| 481 |
+
$related_list[] = $rp;
|
| 482 |
+
}
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
return $related_list;
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
private function getRelatedProducts($quote)
|
| 489 |
+
{
|
| 490 |
$id_list = array();
|
| 491 |
+
$grouped_id_list = array();
|
| 492 |
+
$filter_id_list = array();
|
| 493 |
|
| 494 |
+
foreach ($quote->getAllItems() as $item)
|
| 495 |
{
|
| 496 |
+
// if it is a grouped product get the parent ID and add it to the list (if not already added)
|
| 497 |
+
if ($item->getProductType() == 'grouped')
|
| 498 |
+
{
|
| 499 |
+
$grouped_product_id = $this->getGroupedProductId($item);
|
| 500 |
+
|
| 501 |
+
if (!in_array($grouped_product_id, $grouped_id_list))
|
| 502 |
+
$grouped_id_list[] = $grouped_product_id;
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
if ($product = $item->getProduct())
|
| 506 |
+
{
|
| 507 |
+
$product_id = $product->getId();
|
| 508 |
+
if (!in_array($product_id, $id_list))
|
| 509 |
+
$id_list[] = $product_id;
|
| 510 |
+
}
|
| 511 |
}
|
| 512 |
|
| 513 |
+
$max_count = $this->_helper->config('related_fields');
|
| 514 |
+
|
| 515 |
+
$related = $this->getRelatedCollection($id_list, $max_count);
|
| 516 |
+
|
| 517 |
+
if (count($related) < $max_count)
|
| 518 |
+
{
|
| 519 |
+
// get grouped related
|
| 520 |
+
$grouped_related = $this->getRelatedCollection($grouped_id_list, $max_count - count($related), $id_list);
|
| 521 |
+
|
| 522 |
+
// Merge the collections
|
| 523 |
+
if (count($grouped_related) > 0)
|
| 524 |
+
return array_merge($related, $grouped_related);
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
return $related;
|
| 528 |
+
}
|
| 529 |
|
| 530 |
+
private function getRelatedOrderItems($quote, $merge_vars)
|
| 531 |
+
{
|
| 532 |
+
$prefix = "Related";
|
| 533 |
+
$max_count = $this->_helper->config('related_fields');
|
| 534 |
+
|
| 535 |
+
$related_products = $this->getRelatedProducts($quote);
|
| 536 |
|
| 537 |
$count = 0;
|
| 538 |
|
| 543 |
if ($count > $max_count)
|
| 544 |
break;
|
| 545 |
|
| 546 |
+
$merge_vars = $this->addMergeItem($rp->getId(), $count, $merge_vars, $prefix);
|
| 547 |
}
|
| 548 |
|
| 549 |
while ($count < $max_count)
|
| 555 |
return $merge_vars;
|
| 556 |
}
|
| 557 |
|
| 558 |
+
private function getGroupedProductId($item)
|
| 559 |
+
{
|
| 560 |
+
$options = $item->getProductOptions();
|
| 561 |
+
|
| 562 |
+
if (isset($options['super_product_config']))
|
| 563 |
+
{
|
| 564 |
+
if (isset($options['super_product_config']['product_id']))
|
| 565 |
+
{
|
| 566 |
+
$product_id = $options['super_product_config']['product_id'];
|
| 567 |
+
|
| 568 |
+
return $product_id;
|
| 569 |
+
}
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
return false;
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
private function getGroupedProduct($item)
|
| 576 |
+
{
|
| 577 |
+
$product_id = $this->getGroupedProductId($item);
|
| 578 |
+
|
| 579 |
+
if ($product_id !== false)
|
| 580 |
+
{
|
| 581 |
+
$product = Mage::getModel('catalog/product')->load($product_id);
|
| 582 |
+
|
| 583 |
+
if ($product->getId())
|
| 584 |
+
return $product;
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
return false;
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
private function getMergeOrderItems($quote, $merge_vars, $prefix = "")
|
| 591 |
{
|
| 592 |
$max_count = $this->_helper->config('product_fields');
|
| 593 |
|
| 594 |
$count = 0;
|
| 595 |
|
| 596 |
+
$item_list = array();
|
| 597 |
+
$item_data = array();
|
| 598 |
+
|
| 599 |
+
$parent_items = array();
|
| 600 |
+
|
| 601 |
+
foreach ($quote->getAllItems() as $item)
|
| 602 |
+
{
|
| 603 |
+
$type = $item->getProductType();
|
| 604 |
+
if ($type == "configurable" || $type == "bundle")
|
| 605 |
+
$parent_items[$item->getId()] = $item;
|
| 606 |
+
|
| 607 |
+
if ($type == "grouped")
|
| 608 |
+
{
|
| 609 |
+
$grouped_product = $this->getGroupedProduct($item);
|
| 610 |
+
|
| 611 |
+
if ($grouped_product)
|
| 612 |
+
{
|
| 613 |
+
$parent_item = new Varien_Object;
|
| 614 |
+
$parent_item->setProduct($grouped_product);
|
| 615 |
+
$parent_items[$item->getId()] = $parent_item;
|
| 616 |
+
}
|
| 617 |
+
}
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
+
foreach ($quote->getAllItems() as $item)
|
| 621 |
+
{
|
| 622 |
+
$type = $item->getProductType();
|
| 623 |
+
if ($type == "configurable" || $type == "bundle")
|
| 624 |
+
continue;
|
| 625 |
+
|
| 626 |
+
$item_id = $item->getId();
|
| 627 |
+
|
| 628 |
+
if ($item->getProductType() == 'grouped')
|
| 629 |
+
$parent_id = $item->getId();
|
| 630 |
+
else
|
| 631 |
+
$parent_id = $item->getParentItemId();
|
| 632 |
+
|
| 633 |
+
$product = $item->getProduct();
|
| 634 |
+
|
| 635 |
+
$vis_flag = Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE;
|
| 636 |
+
|
| 637 |
+
if ($parent_id != null && isset($parent_items[$parent_id]))
|
| 638 |
+
{
|
| 639 |
+
$parent_item = $parent_items[$parent_id];
|
| 640 |
+
|
| 641 |
+
if ($product->getVisibility() != $vis_flag || $parent_item->getProduct()->getVisibility() != $vis_flag)
|
| 642 |
+
$item_data[$item_id] = array('item' => $item, 'parent' => $parent_item);
|
| 643 |
+
}
|
| 644 |
+
else
|
| 645 |
+
{
|
| 646 |
+
if ($product->getVisibility() != Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)
|
| 647 |
+
$item_data[$item_id] = array('item' => $item);
|
| 648 |
+
}
|
| 649 |
+
}
|
| 650 |
+
|
| 651 |
+
foreach ($item_data as $item)
|
| 652 |
{
|
| 653 |
$count++;
|
| 654 |
|
| 688 |
{
|
| 689 |
try
|
| 690 |
{
|
| 691 |
+
$starting_store = Mage::app()->getStore()->getCode();
|
| 692 |
+
|
| 693 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::CUSTOMER);
|
| 694 |
|
| 695 |
$customer = $observer->getEvent()->getCustomer();
|
| 706 |
return $observer;
|
| 707 |
}
|
| 708 |
else
|
| 709 |
+
Mage::app()->setCurrentStore($customer_store);
|
| 710 |
}
|
| 711 |
|
| 712 |
$this->_helper->log("Update Customer Start");
|
| 714 |
if (!$this->_helper->canEdirect())
|
| 715 |
{
|
| 716 |
$this->_helper->logReason($this->_helper->getDisabledReason());
|
| 717 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 718 |
return $observer;
|
| 719 |
}
|
| 720 |
|
| 761 |
$this->_helper->logException($e);
|
| 762 |
}
|
| 763 |
|
| 764 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 765 |
return $observer;
|
| 766 |
}
|
| 767 |
|
| 768 |
+
private function forceSubscribe()
|
| 769 |
+
{
|
| 770 |
+
$option = (int)$this->_helper->config('checkout_subscribe');
|
| 771 |
+
|
| 772 |
+
// Force subscribe on
|
| 773 |
+
if ($option == 3)
|
| 774 |
+
return true;
|
| 775 |
+
|
| 776 |
+
return false;
|
| 777 |
+
}
|
| 778 |
+
|
| 779 |
public function registerCheckoutSubscribe(Varien_Event_Observer $observer)
|
| 780 |
{
|
| 781 |
try
|
| 789 |
}
|
| 790 |
$subscribe = Mage::app()->getRequest()->getPost('emaildirect_subscribe');
|
| 791 |
|
| 792 |
+
if(!is_null($subscribe) || $this->forceSubscribe())
|
| 793 |
Mage::getSingleton('core/session')->setEmaildirectCheckout($subscribe);
|
| 794 |
|
| 795 |
$this->_helper->log("Register Checkout Subscribe End");
|
| 810 |
{
|
| 811 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::NEWSLETTER);
|
| 812 |
$this->_helper->log("Register Checkout Success Start");
|
| 813 |
+
|
| 814 |
+
if (!$this->_helper->canEdirect())
|
| 815 |
{
|
| 816 |
$this->_helper->logReason($this->_helper->getDisabledReason());
|
| 817 |
return;
|
| 824 |
return;
|
| 825 |
}
|
| 826 |
|
| 827 |
+
$order_id = (int)current($observer->getEvent()->getOrderIds());
|
| 828 |
|
| 829 |
+
if (!$order_id)
|
| 830 |
{
|
| 831 |
$this->_helper->logReason("Order ID not found.");
|
| 832 |
return;
|
| 833 |
}
|
| 834 |
|
| 835 |
+
$order = Mage::getModel('sales/order')->load($order_id);
|
| 836 |
if (!$order->getId())
|
| 837 |
{
|
| 838 |
+
$this->_helper->logReason("Failed to Load Order ({$order_id}).");
|
| 839 |
return;
|
| 840 |
}
|
| 841 |
|
| 842 |
$this->_helper->log("Processing Order # " . $order->getIncrementId());
|
| 843 |
|
| 844 |
//Guest Checkout
|
| 845 |
+
if ((int)$order->getCustomerGroupId() === Mage_Customer_Model_Group::NOT_LOGGED_IN_ID )
|
| 846 |
{
|
| 847 |
$this->_helper->log("Guest Checkout");
|
| 848 |
$this->_helper->registerGuestCustomer($order);
|
| 849 |
}
|
| 850 |
|
| 851 |
+
$subscriber = Mage::getModel('newsletter/subscriber')
|
| 852 |
->subscribe($order->getCustomerEmail());
|
| 853 |
|
| 854 |
$this->_helper->log("Register Checkout Success End");
|
| 1025 |
{
|
| 1026 |
try
|
| 1027 |
{
|
| 1028 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1029 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
|
| 1030 |
$this->_helper->log("Process Batch Orders Start");
|
| 1031 |
|
| 1032 |
$stores = Mage::app()->getStores();
|
| 1033 |
|
|
|
|
|
|
|
| 1034 |
foreach ($stores as $store)
|
| 1035 |
{
|
| 1036 |
Mage::app()->setCurrentStore($store->getCode());
|
|
|
|
| 1037 |
|
| 1038 |
$this->processBatchStoreOrders($store);
|
| 1039 |
}
|
| 1040 |
|
| 1041 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1042 |
|
| 1043 |
$this->_helper->log("Process Batch Orders End");
|
| 1044 |
}
|
| 1056 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ORDERS);
|
| 1057 |
$this->_helper->log("Process Saved Order Start");
|
| 1058 |
|
| 1059 |
+
$this->_helper->log("Order ID: " . $order->getIncrementId());
|
| 1060 |
|
| 1061 |
$this->_helper->log("Order Store: " . $order->getStoreId());
|
| 1062 |
+
$starting_store = Mage::app()->getStore()->getCode();
|
| 1063 |
+
|
| 1064 |
+
Mage::app()->setCurrentStore($order->getStoreId());
|
| 1065 |
|
| 1066 |
if (!$this->_helper->getOrdersEnabled())
|
| 1067 |
{
|
| 1068 |
$this->_helper->logReason($this->_helper->getOrdersDisabledReason());
|
| 1069 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 1070 |
return;
|
| 1071 |
}
|
| 1072 |
|
| 1073 |
if (!$this->canSendOrder($order, $batch))
|
| 1074 |
+
{
|
| 1075 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 1076 |
return;
|
| 1077 |
+
}
|
| 1078 |
|
| 1079 |
$this->_helper->log("Order is ready to send. Processing...");
|
| 1080 |
|
| 1099 |
$address = Mage::getModel('customer/address')->load($customer->getDefaultBilling());
|
| 1100 |
$customer->setBillingAddress($address);
|
| 1101 |
}
|
| 1102 |
+
|
| 1103 |
$merge_vars = $this->_helper->getMergeVars($customer, true);
|
| 1104 |
$merge_vars = $this->_helper->getOrderMergeVars($merge_vars,$order);
|
| 1105 |
|
| 1130 |
Mage::logException($e);
|
| 1131 |
$this->_helper->logException($e);
|
| 1132 |
}
|
| 1133 |
+
|
| 1134 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 1135 |
}
|
| 1136 |
|
| 1137 |
public function orderSaveAfter(Varien_Event_Observer $observer)
|
| 1392 |
{
|
| 1393 |
try
|
| 1394 |
{
|
| 1395 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1396 |
+
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
|
| 1397 |
$this->_helper->log("Manual Abandoned Carts Processor Start");
|
| 1398 |
|
| 1399 |
$check_date = $this->getAbandonedTime();
|
| 1402 |
|
| 1403 |
$stores = Mage::app()->getStores();
|
| 1404 |
|
|
|
|
|
|
|
| 1405 |
foreach ($stores as $store)
|
| 1406 |
{
|
| 1407 |
if ($store_id == null || $store_id == $store->getId())
|
| 1408 |
{
|
| 1409 |
Mage::app()->setCurrentStore($store->getCode());
|
| 1410 |
+
|
| 1411 |
$this->abandonedStoreProcessor($store, $check_date);
|
| 1412 |
}
|
| 1413 |
}
|
| 1414 |
|
| 1415 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1416 |
|
| 1417 |
$this->_helper->log("Manual Abandoned Carts Processor End");
|
| 1418 |
}
|
| 1427 |
{
|
| 1428 |
try
|
| 1429 |
{
|
| 1430 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1431 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
|
| 1432 |
$this->_helper->log("Abandoned Carts Processor Start");
|
| 1433 |
|
| 1437 |
|
| 1438 |
$stores = Mage::app()->getStores();
|
| 1439 |
|
| 1440 |
+
//$starting_store = Mage::app()->getStore()->getCode();
|
| 1441 |
|
| 1442 |
foreach ($stores as $store)
|
| 1443 |
{
|
| 1446 |
$this->abandonedStoreProcessor($store, $check_date);
|
| 1447 |
}
|
| 1448 |
|
| 1449 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1450 |
|
| 1451 |
$date = date(Mage::getModel('core/date')->gmtTimestamp());
|
| 1452 |
$date = date($this->_date_format, $date);
|
| 1469 |
{
|
| 1470 |
$count = 0;
|
| 1471 |
|
| 1472 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1473 |
+
|
| 1474 |
$this->_helper->setLogArea(EmailDirect_Integration_Helper_Data::ABANDONED_CART);
|
| 1475 |
$this->_helper->log("Sending Specific Abandoned Carts Start");
|
| 1476 |
|
| 1480 |
|
| 1481 |
$stores = Mage::app()->getStores();
|
| 1482 |
|
|
|
|
|
|
|
| 1483 |
foreach ($stores as $store)
|
| 1484 |
{
|
| 1485 |
$this->_helper->log("Checking for valid carts in store: {$store->getName()} ({$store->getId()})");
|
| 1500 |
|
| 1501 |
$this->_helper->log("SQL: " . $collection->getSelect()->__toString());
|
| 1502 |
|
| 1503 |
+
|
| 1504 |
$this->_abandonedCartsProcessor($collection, $store, false);
|
| 1505 |
}
|
| 1506 |
|
| 1507 |
+
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
|
| 1508 |
|
| 1509 |
$this->_helper->log("Sending Specific Abandoned Carts End");
|
| 1510 |
|
| 1514 |
{
|
| 1515 |
Mage::logException($e);
|
| 1516 |
$this->_helper->logException($e);
|
| 1517 |
+
$this->_helper->resetCurrentStore();
|
| 1518 |
}
|
| 1519 |
}
|
| 1520 |
+
|
|
|
|
|
|
|
| 1521 |
private function getAbandonedUrl($quote)
|
| 1522 |
{
|
| 1523 |
// We are using comma separated lists for the ID's and Quantities so that it takes up less
|
| 1524 |
// space when we generate the Querystring
|
| 1525 |
+
|
| 1526 |
+
$item_data = array();
|
| 1527 |
|
| 1528 |
+
foreach ($quote->getAllItems() as $item)
|
| 1529 |
+
{
|
| 1530 |
+
$product = $item->getProduct();
|
| 1531 |
+
$parent_id = $item->getParentItemId();
|
| 1532 |
+
|
| 1533 |
+
if ($parent_id != null)
|
| 1534 |
+
{
|
| 1535 |
+
$item_data[$parent_id]['option'] = $product->getId();
|
| 1536 |
+
}
|
| 1537 |
+
else
|
| 1538 |
+
{
|
| 1539 |
+
$item_data[$item->getId()]['product_id'] = $product->getId();
|
| 1540 |
+
$item_data[$item->getId()]['qty'] = $item->getQty();
|
| 1541 |
+
|
| 1542 |
+
if ($item->getProductType() == 'grouped')
|
| 1543 |
+
{
|
| 1544 |
+
$option = $item->getOptionByCode('product_type');
|
| 1545 |
+
if ($option)
|
| 1546 |
+
{
|
| 1547 |
+
$product = $option->getProduct();
|
| 1548 |
+
$item_data[$item->getId()]['option'] = $product->getId();
|
| 1549 |
+
}
|
| 1550 |
+
}
|
| 1551 |
+
else if ($item->getProductType() == 'bundle')
|
| 1552 |
+
{
|
| 1553 |
+
$option = $item->getOptionByCode('info_buyRequest');
|
| 1554 |
+
|
| 1555 |
+
if ($option)
|
| 1556 |
+
{
|
| 1557 |
+
$data = unserialize($option->getValue());
|
| 1558 |
+
|
| 1559 |
+
$bundle_option = "";
|
| 1560 |
+
|
| 1561 |
+
foreach ($data['bundle_option'] as $id => $value)
|
| 1562 |
+
{
|
| 1563 |
+
if ($bundle_option != "")
|
| 1564 |
+
$bundle_option .= "-";
|
| 1565 |
+
|
| 1566 |
+
$bundle_option .= "{$id}=";
|
| 1567 |
+
|
| 1568 |
+
if (is_array($value))
|
| 1569 |
+
{
|
| 1570 |
+
$bundle_option .= implode(":",$value);
|
| 1571 |
+
}
|
| 1572 |
+
else
|
| 1573 |
+
{
|
| 1574 |
+
$qty = $data['bundle_option_qty'][$id];
|
| 1575 |
+
$bundle_option .= "{$value}~{$qty}";
|
| 1576 |
+
}
|
| 1577 |
+
}
|
| 1578 |
+
$item_data[$item->getId()]['bundle_option'] = $bundle_option;
|
| 1579 |
+
}
|
| 1580 |
+
}
|
| 1581 |
+
}
|
| 1582 |
+
}
|
| 1583 |
+
|
| 1584 |
+
$ids = "";
|
| 1585 |
$qtys = "";
|
| 1586 |
+
|
| 1587 |
+
foreach ($item_data as $item)
|
| 1588 |
+
{
|
| 1589 |
+
if ($ids != "")
|
| 1590 |
{
|
| 1591 |
$ids .= ",";
|
| 1592 |
$qtys .= ",";
|
| 1593 |
}
|
| 1594 |
+
|
| 1595 |
+
$ids .= $item['product_id'];
|
| 1596 |
+
$qtys .= $item['qty'];
|
| 1597 |
+
|
| 1598 |
+
if (isset($item['bundle_option']))
|
| 1599 |
+
$ids .= "|{$item['bundle_option']}";
|
| 1600 |
+
else if (isset($item['option']))
|
| 1601 |
+
$ids .= "|{$item['option']}";
|
| 1602 |
+
}
|
| 1603 |
+
|
| 1604 |
+
$url_data = array("quote" => $quote->getId(), "id" => $ids, "qty" => $qtys);
|
| 1605 |
+
|
| 1606 |
+
$this->_helper->log($url_data, "Abandoned Url Data");
|
| 1607 |
+
|
| 1608 |
$url = base64_encode(serialize($url_data));
|
| 1609 |
|
| 1610 |
$url = Mage::getUrl('emaildirect/abandoned/restore',array('_secure'=>true)) . "?cart={$url}";
|
| 1611 |
|
| 1612 |
return $url;
|
| 1613 |
}
|
| 1614 |
+
// END ABANDONED CRON
|
| 1615 |
+
|
| 1616 |
+
// START QUOTE SAVE AFTER
|
| 1617 |
public function quoteSaveAfter(Varien_Event_Observer $observer)
|
| 1618 |
{
|
| 1619 |
try
|
app/code/community/EmailDirect/Integration/Model/Wrapper/Orders.php
CHANGED
|
@@ -15,13 +15,28 @@ class EmailDirect_Integration_Model_Wrapper_Orders extends EmailDirect_Integrati
|
|
| 15 |
$xml .= "<PurchaseDate>{$date}</PurchaseDate>";
|
| 16 |
$xml .= "<OrderNumber>{$orderNum}</OrderNumber>";
|
| 17 |
|
|
|
|
| 18 |
if (is_array($items))
|
| 19 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
$xml .= "<Items>";
|
| 21 |
foreach($items as $item)
|
| 22 |
{
|
|
|
|
| 23 |
if ($item->getParentItemId() != null)
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
$qty = (int)$item->getQtyOrdered();
|
| 27 |
$xml .= "<OrderItem>";
|
| 15 |
$xml .= "<PurchaseDate>{$date}</PurchaseDate>";
|
| 16 |
$xml .= "<OrderNumber>{$orderNum}</OrderNumber>";
|
| 17 |
|
| 18 |
+
|
| 19 |
if (is_array($items))
|
| 20 |
{
|
| 21 |
+
$parent_items = array();
|
| 22 |
+
foreach($items as $item)
|
| 23 |
+
{
|
| 24 |
+
$type = $item->getProductType();
|
| 25 |
+
if ($type == "bundle")
|
| 26 |
+
$parent_items[$item->getId()] = $item;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
$xml .= "<Items>";
|
| 30 |
foreach($items as $item)
|
| 31 |
{
|
| 32 |
+
$parent = null;
|
| 33 |
if ($item->getParentItemId() != null)
|
| 34 |
+
{
|
| 35 |
+
if (isset($parent_items[$item->getParentItemId()]))
|
| 36 |
+
$parent = $parent_items[$item->getParentItemId()];
|
| 37 |
+
else
|
| 38 |
+
continue;
|
| 39 |
+
}
|
| 40 |
|
| 41 |
$qty = (int)$item->getQtyOrdered();
|
| 42 |
$xml .= "<OrderItem>";
|
app/code/community/EmailDirect/Integration/Model/Wrapper/Subscribers.php
CHANGED
|
@@ -34,7 +34,7 @@ class EmailDirect_Integration_Model_Wrapper_subscribers extends EmailDirect_Inte
|
|
| 34 |
$custom_fields = $this->getCustomFields($merge_vars);
|
| 35 |
|
| 36 |
$xml = "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$extra_data}{$publication_data}{$list_data}<Force>true</Force></Subscriber>";
|
| 37 |
-
|
| 38 |
$rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
|
| 39 |
|
| 40 |
return $rc;
|
| 34 |
$custom_fields = $this->getCustomFields($merge_vars);
|
| 35 |
|
| 36 |
$xml = "<Subscriber><EmailAddress>{$email}</EmailAddress>{$custom_fields}{$source_data}{$extra_data}{$publication_data}{$list_data}<Force>true</Force></Subscriber>";
|
| 37 |
+
|
| 38 |
$rc = Mage::getSingleton('emaildirect/wrapper_execute')->sendCommand("subscribers","","",$xml);
|
| 39 |
|
| 40 |
return $rc;
|
app/code/community/EmailDirect/Integration/controllers/AbandonedController.php
CHANGED
|
@@ -1,33 +1,169 @@
|
|
| 1 |
<?php
|
| 2 |
|
| 3 |
class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_Front_Action
|
| 4 |
-
{
|
| 5 |
public function restoreAction()
|
| 6 |
{
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
$
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
$
|
| 15 |
}
|
| 16 |
|
| 17 |
-
private function
|
| 18 |
{
|
| 19 |
$id_list = explode(",",$cart_data['id']);
|
| 20 |
$qty_list = explode(",",$cart_data['qty']);
|
| 21 |
|
| 22 |
-
$
|
|
|
|
|
|
|
| 23 |
|
| 24 |
foreach ($id_list as $key => $item_id)
|
| 25 |
{
|
|
|
|
| 26 |
$qty = $qty_list[$key];
|
| 27 |
|
| 28 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
// update our totals, save.
|
| 32 |
$quote->getBillingAddress();
|
| 33 |
$quote->collectTotals();
|
|
@@ -36,24 +172,31 @@ class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_F
|
|
| 36 |
$this->getCheckout()->setQuoteId($quote->getId());
|
| 37 |
}
|
| 38 |
|
| 39 |
-
private function addItemToCart($
|
| 40 |
{
|
| 41 |
-
$product = Mage::getModel('catalog/product')->load($id);
|
| 42 |
-
|
| 43 |
-
if (!$product->getId())
|
| 44 |
-
return false;
|
| 45 |
-
|
| 46 |
-
$data = array(
|
| 47 |
-
'qty' => $qty,
|
| 48 |
-
'options' => array()
|
| 49 |
-
);
|
| 50 |
-
|
| 51 |
-
$quote = $this->getQuote();
|
| 52 |
-
|
| 53 |
try
|
| 54 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
// add the product to our quote
|
| 56 |
-
$quote->addProductAdvanced($product
|
| 57 |
|
| 58 |
return true;
|
| 59 |
}
|
|
@@ -78,8 +221,8 @@ class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_F
|
|
| 78 |
|
| 79 |
$checkout = $this->getCheckout();
|
| 80 |
|
| 81 |
-
$checkout->clear();
|
| 82 |
-
|
| 83 |
$quote = $this->getQuote();
|
| 84 |
|
| 85 |
// Check to see if we need to remove the quote
|
| 1 |
<?php
|
| 2 |
|
| 3 |
class EmailDirect_Integration_AbandonedController extends Mage_Core_Controller_Front_Action
|
| 4 |
+
{
|
| 5 |
public function restoreAction()
|
| 6 |
{
|
| 7 |
+
try
|
| 8 |
+
{
|
| 9 |
+
$coded_cart = Mage::app()->getRequest()->getParam('cart');
|
| 10 |
+
|
| 11 |
+
$cart_data = unserialize(base64_decode($coded_cart));
|
| 12 |
+
|
| 13 |
+
$this->clearCart($cart_data['quote']);
|
| 14 |
+
$this->restoreCartItems($cart_data);
|
| 15 |
+
|
| 16 |
+
$this->_redirect("checkout/cart");
|
| 17 |
+
}
|
| 18 |
+
catch (Exception $e)
|
| 19 |
+
{
|
| 20 |
+
$this->getCheckout()->addError('Unable to Restore your cart');
|
| 21 |
+
Mage::logException($e);
|
| 22 |
+
$this->_redirect("checkout/cart");
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
private function processBundleOptions($option)
|
| 27 |
+
{
|
| 28 |
+
$option_data = explode("-", $option);
|
| 29 |
|
| 30 |
+
$bundle_option = array();
|
| 31 |
+
$bundle_option_qty = array();
|
| 32 |
|
| 33 |
+
foreach ($option_data as $od)
|
| 34 |
+
{
|
| 35 |
+
$od_parts = explode("=",$od);
|
| 36 |
+
|
| 37 |
+
$option_id = $od_parts[0];
|
| 38 |
+
|
| 39 |
+
$products = $od_parts[1];
|
| 40 |
+
|
| 41 |
+
if (strpos($products,"~"))
|
| 42 |
+
{
|
| 43 |
+
// Single Item with Qty
|
| 44 |
+
$option_products = explode("~",$products);
|
| 45 |
+
|
| 46 |
+
$bundle_option[$option_id] = $option_products[0];
|
| 47 |
+
|
| 48 |
+
$bundle_option_qty[$option_id] = $option_products[1];
|
| 49 |
+
}
|
| 50 |
+
else
|
| 51 |
+
{
|
| 52 |
+
// 1 or more items with no qty
|
| 53 |
+
$option_products = explode(":",$products);
|
| 54 |
+
|
| 55 |
+
foreach ($option_products as $op)
|
| 56 |
+
{
|
| 57 |
+
$bundle_option[$option_id][] = $op;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
|
| 62 |
+
return array('bundle_option' => $bundle_option, 'bundle_option_qty' => $bundle_option_qty);
|
| 63 |
}
|
| 64 |
|
| 65 |
+
private function prepareCartItems($cart_data)
|
| 66 |
{
|
| 67 |
$id_list = explode(",",$cart_data['id']);
|
| 68 |
$qty_list = explode(",",$cart_data['qty']);
|
| 69 |
|
| 70 |
+
$item_list = array();
|
| 71 |
+
$group_list = array();
|
| 72 |
+
$position = 0;
|
| 73 |
|
| 74 |
foreach ($id_list as $key => $item_id)
|
| 75 |
{
|
| 76 |
+
$position++;
|
| 77 |
$qty = $qty_list[$key];
|
| 78 |
|
| 79 |
+
$id_parts = explode('|',$item_id);
|
| 80 |
+
|
| 81 |
+
// If there is more than just an id then we have a complex product
|
| 82 |
+
if (count($id_parts) > 1)
|
| 83 |
+
{
|
| 84 |
+
$id = $id_parts[0];
|
| 85 |
+
$option = $id_parts[1];
|
| 86 |
+
|
| 87 |
+
// MAKE SURE WE CAN LOAD THE PRODUCT
|
| 88 |
+
$product = Mage::getModel('catalog/product')->load($id);
|
| 89 |
+
if (!$product)
|
| 90 |
+
continue;
|
| 91 |
+
|
| 92 |
+
switch ($product->getTypeId())
|
| 93 |
+
{
|
| 94 |
+
case "configurable":
|
| 95 |
+
{
|
| 96 |
+
$item_list[$position] = array(
|
| 97 |
+
'product_type' => 'configurable',
|
| 98 |
+
'product' => $product,
|
| 99 |
+
'qty' => $qty,
|
| 100 |
+
'option' => array('super_attribute' => Mage::helper('emaildirect')->getConfigurableOptions($product,$option))
|
| 101 |
+
);
|
| 102 |
+
} break;
|
| 103 |
+
case "simple": // Grouped simple products
|
| 104 |
+
{
|
| 105 |
+
$parent_product = Mage::getModel('catalog/product')->load($option);
|
| 106 |
+
|
| 107 |
+
if (!$parent_product)
|
| 108 |
+
continue;
|
| 109 |
+
|
| 110 |
+
if (!isset($group_list[$option]))
|
| 111 |
+
{
|
| 112 |
+
$group_list[$option] = array(
|
| 113 |
+
'position' => $position,
|
| 114 |
+
'product_type' => 'grouped',
|
| 115 |
+
'product' => $parent_product,
|
| 116 |
+
'option' => array('super_group' => array())
|
| 117 |
+
);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
$group_list[$option]['option']['super_group'][$id] = $qty;
|
| 121 |
+
} break;
|
| 122 |
+
case "bundle":
|
| 123 |
+
{
|
| 124 |
+
$item_list[$position] = array(
|
| 125 |
+
'product_type' => 'bundle',
|
| 126 |
+
'product' => $product,
|
| 127 |
+
'qty' => $qty,
|
| 128 |
+
'option' => $this->processBundleOptions($option)
|
| 129 |
+
);
|
| 130 |
+
} break;
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
else
|
| 134 |
+
{
|
| 135 |
+
// Simple Product
|
| 136 |
+
$item_list[] = array(
|
| 137 |
+
'product_type' => 'simple',
|
| 138 |
+
'product' => $product,
|
| 139 |
+
'qty' => $qty
|
| 140 |
+
);
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
// Merge the group and simple products
|
| 145 |
+
foreach ($group_list as $group)
|
| 146 |
+
{
|
| 147 |
+
$item_list[$group['position']] = $group;
|
| 148 |
}
|
| 149 |
|
| 150 |
+
// Sort it so that the order matches the cart order
|
| 151 |
+
ksort($item_list);
|
| 152 |
+
|
| 153 |
+
return $item_list;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
private function restoreCartItems($cart_data)
|
| 157 |
+
{
|
| 158 |
+
$quote = $this->getQuote();
|
| 159 |
+
|
| 160 |
+
$item_list = $this->prepareCartItems($cart_data);
|
| 161 |
+
|
| 162 |
+
foreach ($item_list as $item)
|
| 163 |
+
{
|
| 164 |
+
$this->addItemToCart($item);
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
// update our totals, save.
|
| 168 |
$quote->getBillingAddress();
|
| 169 |
$quote->collectTotals();
|
| 172 |
$this->getCheckout()->setQuoteId($quote->getId());
|
| 173 |
}
|
| 174 |
|
| 175 |
+
private function addItemToCart($item)
|
| 176 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
try
|
| 178 |
{
|
| 179 |
+
$product = $item['product'];
|
| 180 |
+
|
| 181 |
+
$data = array(
|
| 182 |
+
'options' => array()
|
| 183 |
+
);
|
| 184 |
+
|
| 185 |
+
if (isset($item['qty']))
|
| 186 |
+
$data['qty'] = $item['qty'];
|
| 187 |
+
|
| 188 |
+
if (isset($item['option']))
|
| 189 |
+
{
|
| 190 |
+
foreach ($item['option'] as $key => $option)
|
| 191 |
+
{
|
| 192 |
+
$data[$key] = $option;
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
$quote = $this->getQuote();
|
| 197 |
+
|
| 198 |
// add the product to our quote
|
| 199 |
+
$quote->addProductAdvanced($product, new Varien_Object($data));
|
| 200 |
|
| 201 |
return true;
|
| 202 |
}
|
| 221 |
|
| 222 |
$checkout = $this->getCheckout();
|
| 223 |
|
| 224 |
+
$checkout->clear();
|
| 225 |
+
|
| 226 |
$quote = $this->getQuote();
|
| 227 |
|
| 228 |
// Check to see if we need to remove the quote
|
app/code/community/EmailDirect/Integration/controllers/Admin/ExportController.php
CHANGED
|
@@ -308,7 +308,10 @@ class EmailDirect_Integration_Admin_ExportController extends Mage_Adminhtml_Cont
|
|
| 308 |
$file_name = $this->getRequest()->getPost('filename', 0);
|
| 309 |
$store = $this->getRequest()->getPost('store', 0);
|
| 310 |
if ($store != 0)
|
| 311 |
-
|
|
|
|
|
|
|
|
|
|
| 312 |
|
| 313 |
$url = $this->getUrl('*/*/download') . "filename/{$file_name}/export_type/" . $this->getExportType();
|
| 314 |
|
|
@@ -325,6 +328,9 @@ class EmailDirect_Integration_Admin_ExportController extends Mage_Adminhtml_Cont
|
|
| 325 |
$result['error'] = "EmailDirect Error: (" . (string) $rc->ErrorCode . "): " . (string)$rc->Message;
|
| 326 |
}
|
| 327 |
|
|
|
|
|
|
|
|
|
|
| 328 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
| 329 |
}
|
| 330 |
}
|
| 308 |
$file_name = $this->getRequest()->getPost('filename', 0);
|
| 309 |
$store = $this->getRequest()->getPost('store', 0);
|
| 310 |
if ($store != 0)
|
| 311 |
+
{
|
| 312 |
+
$starting_store = Mage::app()->getStore()->getCode();
|
| 313 |
+
Mage::app()->setCurrentStore($store);
|
| 314 |
+
}
|
| 315 |
|
| 316 |
$url = $this->getUrl('*/*/download') . "filename/{$file_name}/export_type/" . $this->getExportType();
|
| 317 |
|
| 328 |
$result['error'] = "EmailDirect Error: (" . (string) $rc->ErrorCode . "): " . (string)$rc->Message;
|
| 329 |
}
|
| 330 |
|
| 331 |
+
if ($store != 0)
|
| 332 |
+
Mage::app()->setCurrentStore($starting_store);
|
| 333 |
+
|
| 334 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
| 335 |
}
|
| 336 |
}
|
app/code/community/EmailDirect/Integration/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<EmailDirect_Integration>
|
| 5 |
-
<version>2.0.
|
| 6 |
</EmailDirect_Integration>
|
| 7 |
</modules>
|
| 8 |
<global>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<EmailDirect_Integration>
|
| 5 |
+
<version>2.0.3</version>
|
| 6 |
</EmailDirect_Integration>
|
| 7 |
</modules>
|
| 8 |
<global>
|
app/design/adminhtml/default/default/template/emaildirect/system/config/fieldset/hint.phtml
CHANGED
|
@@ -35,6 +35,8 @@ document.observe('dom:loaded', function()
|
|
| 35 |
var name = id_parts.slice(3).join('_');
|
| 36 |
switch (name)
|
| 37 |
{
|
|
|
|
|
|
|
| 38 |
case 'apikey':
|
| 39 |
case 'apikey_instructions': break;
|
| 40 |
default: $(id).remove(); break;
|
| 35 |
var name = id_parts.slice(3).join('_');
|
| 36 |
switch (name)
|
| 37 |
{
|
| 38 |
+
case 'heading_general':
|
| 39 |
+
case 'info':
|
| 40 |
case 'apikey':
|
| 41 |
case 'apikey_instructions': break;
|
| 42 |
default: $(id).remove(); break;
|
app/design/frontend/base/default/template/emaildirect/checkout/subscribe.phtml
CHANGED
|
@@ -5,21 +5,21 @@
|
|
| 5 |
<script type="text/javascript">
|
| 6 |
addSubscribeToPost = function (element)
|
| 7 |
{
|
| 8 |
-
|
| 9 |
-
if( $('emaildirect-subscribe') ){
|
| 10 |
$('emaildirect-subscribe').remove();
|
| 11 |
-
}
|
| 12 |
|
| 13 |
-
if(element.checked)
|
|
|
|
| 14 |
var inputer = new Element('input', { name: "emaildirect_subscribe", id: "emaildirect-subscribe", value: "1", type: "hidden" });
|
| 15 |
-
try
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
$("co-payment-form").insert(inputer);
|
| 19 |
}
|
| 20 |
-
|
| 21 |
}
|
| 22 |
-
|
| 23 |
}
|
| 24 |
</script>
|
| 25 |
<div class="buttons-set"<?php if($check === 3): ?> style="display:none;"<?php endif;?>>
|
|
@@ -29,4 +29,4 @@ addSubscribeToPost = function (element)
|
|
| 29 |
|
| 30 |
<script type="text/javascript">
|
| 31 |
addSubscribeToPost($('emaildirect-trigger'));
|
| 32 |
-
</script>
|
| 5 |
<script type="text/javascript">
|
| 6 |
addSubscribeToPost = function (element)
|
| 7 |
{
|
| 8 |
+
if ($('emaildirect-subscribe'))
|
|
|
|
| 9 |
$('emaildirect-subscribe').remove();
|
|
|
|
| 10 |
|
| 11 |
+
if (element.checked)
|
| 12 |
+
{
|
| 13 |
var inputer = new Element('input', { name: "emaildirect_subscribe", id: "emaildirect-subscribe", value: "1", type: "hidden" });
|
| 14 |
+
try
|
| 15 |
+
{
|
| 16 |
+
Element.insert(Form.findFirstElement(payment.form), inputer);
|
| 17 |
+
}
|
| 18 |
+
catch (notelem)
|
| 19 |
+
{
|
| 20 |
$("co-payment-form").insert(inputer);
|
| 21 |
}
|
|
|
|
| 22 |
}
|
|
|
|
| 23 |
}
|
| 24 |
</script>
|
| 25 |
<div class="buttons-set"<?php if($check === 3): ?> style="display:none;"<?php endif;?>>
|
| 29 |
|
| 30 |
<script type="text/javascript">
|
| 31 |
addSubscribeToPost($('emaildirect-trigger'));
|
| 32 |
+
</script>
|
app/design/frontend/base/default/template/emaildirect/customer/account/dashboard/info.phtml
CHANGED
|
@@ -1,54 +1,49 @@
|
|
| 1 |
<div class="col2-set">
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 33 |
{
|
| 34 |
-
echo "<
|
| 35 |
-
echo "<ul>";
|
| 36 |
-
foreach ($subscriptions['lists'] as $list)
|
| 37 |
-
{
|
| 38 |
-
echo "<li>{$list['name']}</li>";
|
| 39 |
-
}
|
| 40 |
-
echo "</ul>";
|
| 41 |
}
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
</div>
|
| 53 |
-
<?php endif; ?>
|
| 54 |
</div>
|
| 1 |
<div class="col2-set">
|
| 2 |
+
<div class="col-1">
|
| 3 |
+
<div class="box">
|
| 4 |
+
<div class="box-title">
|
| 5 |
+
<h3><?php echo $this->__('Contact Information') ?></h3>
|
| 6 |
+
<a href="<?php echo $this->getUrl('customer/account/edit') ?>"><?php echo $this->__('Edit') ?></a>
|
| 7 |
+
</div>
|
| 8 |
+
<div class="box-content">
|
| 9 |
+
<p>
|
| 10 |
+
<?php echo $this->htmlEscape($this->getCustomer()->getName()) ?><br />
|
| 11 |
+
<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?><br />
|
| 12 |
+
<a href="<?php echo $this->getChangePasswordUrl() ?>"><?php echo $this->__('Change Password') ?></a>
|
| 13 |
+
</p>
|
| 14 |
+
</div>
|
| 15 |
+
</div>
|
| 16 |
+
</div>
|
| 17 |
+
<?php if ($this->isNewsletterEnabled()): ?>
|
| 18 |
+
<div class="col-2">
|
| 19 |
+
<div class="box">
|
| 20 |
+
<div class="box-title">
|
| 21 |
+
<h3><?php echo $this->__('Newsletters') ?></h3>
|
| 22 |
+
<a href="<?php echo $this->getUrl('newsletter/manage') ?>"><?php echo $this->__('Edit') ?></a>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="box-content">
|
| 25 |
+
<?php
|
| 26 |
+
$subscriptions = $this->getSubscriptions();
|
| 27 |
+
if ($subscriptions['count'] > 0)
|
| 28 |
+
{
|
| 29 |
+
echo "<p>You are currently subscribed to: <br />" . $subscriptions['publication']['name'] . "</p>";
|
| 30 |
+
|
| 31 |
+
if ($subscriptions['list_count'] > 0)
|
| 32 |
+
{
|
| 33 |
+
echo "<strong>Interests:</strong>";
|
| 34 |
+
echo "<ul>";
|
| 35 |
+
foreach ($subscriptions['lists'] as $list)
|
| 36 |
{
|
| 37 |
+
echo "<li>{$list['name']}</li>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
+
echo "</ul>";
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
else
|
| 43 |
+
echo "<p>" . $this->__('You are currently not subscribed to any newsletter.') . "</p>";
|
| 44 |
+
?>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
</div>
|
| 48 |
+
<?php endif; ?>
|
|
|
|
|
|
|
| 49 |
</div>
|
package.xml
CHANGED
|
@@ -1,20 +1,22 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>EmailDirect_Integration</name>
|
| 4 |
-
<version>2.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license/>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>EmailDirect integration for magento</summary>
|
| 10 |
<description>EmailDirect integration for magento</description>
|
| 11 |
-
<notes>
|
| 12 |

|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
<authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
|
| 15 |
-
<date>2014-
|
| 16 |
-
<time>
|
| 17 |
-
<contents><target name="magecommunity"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><file name="Grid.php" hash="4a3f8d29d3d8feb13ae124297267ae85"/><file name="Status.php" hash="9a740fd8c63148532bbcf07d19f462df"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="d01c241e1c4a42cd08f087ad784ed78e"/></dir><dir name="Form"><dir name="Field"><dir name="Export"><file name="Orders.php" hash="5b101fadb6a64044b276eb07b21cf0a5"/><file name="Products.php" hash="32e13d4b7250890bf84aba87f25de03c"/><file name="Range.php" hash="4adac96fa53fa8e1449bae943a8cca80"/></dir><dir name="Signup"><file name="Test.php" hash="3b773dda25c62bc8cb28031931d67f9f"/></dir><file name="Addressmapfields.php" hash="97b75c8340d561e863a3985ad73ce228"/><file name="Common.php" hash="6a86cce53f6df6857ea79241fa281939"/><file name="Info.php" hash="246de52ea5d2349ecd7f103cbba8cb8f"/><file name="Mapfields.php" hash="16894c5d76df1293e63128e349700e05"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/><file name="Troubleshooting.php" hash="ff6b463004ab037031acea4a6f1d8517"/></dir></dir></dir><dir name="Convert"><dir name="Profile"><dir name="Export"><file name="Orders.php" hash="947af2b0d8e3f7bc47c47b32cd434f18"/><file name="Products.php" hash="3f93e4789dbeb6710cd2742587d61726"/></dir><file name="Export.php" hash="ba879607ac0693e9db6251bbbc1676a1"/></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="619916677df7c833e559aae74dae2aa0"/><file name="Info.php" hash="4dad4b18e215d6df8c8e6631b4323b53"/><file name="Log.php" hash="d3dcb67ca284358eaa70db517637da87"/><file name="Submit.php" hash="fe896683680ab10ada6b67e0e803ccce"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Tabs.php" hash="ab1fdbe561e8572c2c50cdbec9573f82"/><file name="View.php" hash="b2d83536aade45e41039875db85b3018"/></dir><file name="Abandoned.php" hash="515b0c172e093341a2e69cb75570e553"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="ae325e815a54bde93507562cf0d86b8a"/></dir><dir name="Customer"><dir name="Account"><dir name="Dashboard"><file name="Info.php" hash="20e74d9c2b2c02611c8f69b254d81ef5"/></dir><file name="Lists.php" hash="3c3bdb9482ecf4a71740a80395bd5465"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="e311f6de480fd4b63aee7f46ea412372"/></dir><file name="Action.php" hash="bf2243f50c9c6dafca26a5bcb889f372"/></dir></dir></dir></dir><file name="Capture.php" hash="b005beb856451f49178f2a6914fd5ae7"/><file name="Signup.php" hash="511c9376560cdc5f63b7dc00bdc205be"/></dir><dir name="Helper"><file name="Data.php" hash="8fc1a924d2c4696df2e660809a897ac9"/><file name="Fields.php" hash="1275a766d979e1ac3efabbf168ac92f5"/><file name="Upgrade.php" hash="407f12bce2c7c06c73a23d8ed853a038"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="5a64b4e8b672f80b4d9b6cc5a0d231eb"/></dir><dir name="Order"><file name="Collection.php" hash="43d343562cf7e54f1b36315aa5d1d4a7"/></dir><dir name="Session"><file name="Collection.php" hash="7d6a8283fdbc1207d709e2bbbc78906d"/></dir><file name="Abandoned.php" hash="485b3771906783d383de75ae9761e55c"/><file name="Order.php" hash="8d538a5737095a1ba0ad448c027b3afb"/><file name="Session.php" hash="516eeeb28038416dc885ed7af6a8a8b0"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Export"><file name="Batch.php" hash="96c51fc5c0b947750be4e612e32c83ab"/></dir><dir name="Send"><file name="Field.php" hash="8ecffa8ccce40f3b2db6513b24eb9200"/></dir><dir name="Signup"><file name="Opacity.php" hash="8eabed4c72e7347f0376c3d4cc1023a7"/><file name="Recurrence.php" hash="e11200bbc204b00486c373d8a4e6675e"/></dir><file name="Abandoned.php" hash="9881811b94f38be90bd20a99951a1903"/><file name="Abandonedlist.php" hash="66386003113d8589c9f3de4f03f538a8"/><file name="Additionallist.php" hash="254081820d07a8754a71743ea58a7af4"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="d76e36c0198e509a63c663e827cc7940"/><file name="Publication.php" hash="635fae1c20981c0ca7b90007a00e99a7"/><file name="Sequence.php" hash="ec9718c2b5dc35c559e5c09e345eff88"/><file name="Source.php" hash="f3c246959c74f6d378f3e2d7b8148d7f"/><file name="States.php" hash="a746affc786d8165a98801e68cbf80ab"/><file name="Statuses.php" hash="9844a7a9c3b5c68df45c8f6c518acf16"/><file name="Time.php" hash="8acbb5cb33e66de1e408cf55d17a9398"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="ef81d36a7276737f2d0aa1a5d783a83b"/><file name="Abstract.php" hash="9e97ce6a12e0d074921bb3a1391f3648"/><file name="Database.php" hash="3cceb467358d13584baff58c043762ec"/><file name="Execute.php" hash="5a339e0a5407cf05b161102fc65595bb"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="425d64b9256bbdbafa899c4138e78368"/><file name="Orders.php" hash="15db3242ec0cbb8db6a4a6fe6b7ebc84"/><file name="Publications.php" hash="815715549df345ccb5b69ed65589aa53"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="21685e41160410b333ac9992ae4fff9d"/></dir><file name="Abandoned.php" hash="93bd43b59b143dec15858a6fba6ae568"/><file name="Observer.php" hash="a22d3137553b5347a0a2167d0207b172"/><file name="Order.php" hash="b21426543cd46f799cd0743525120fb8"/><file name="Session.php" hash="c56ecf779dbfb2dae0030935af31911a"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="04be2181a65e505084b324188f1fd64d"/><file name="ExportController.php" hash="c53499b00fd806eadec5093b0b99aefe"/><file name="TroubleshootingController.php" hash="3de9950849e08648d8872aea4760c992"/></dir><dir name="Customer"><file name="AccountController.php" hash="ae75c37519f8d9f671509ff9b7fb34a4"/></dir><file name="AbandonedController.php" hash="4966cc03e239ec3dccc1bf00439d6e24"/><file name="CaptureController.php" hash="89e043bb3864617a062e915d2209dcf4"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/></dir><dir name="etc"><file name="adminhtml.xml" hash="26c4aa6d38306846a585166d6602b305"/><file name="config.xml" hash="2ddea73568307a916fa7affe694c5c26"/><file name="system.xml" hash="115ba31309c00a99a924dc2862ac23f0"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-2.0.0.php" hash="2ab06feda5e6ee37e8e5006921852f8f"/><file name="mysql4-upgrade-1.5.8-2.0.0.php" hash="20b98743a4ac747d90fec22ff4fbbe10"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="emaildirect"><file name="emaildirect-tab.png" hash="9ddb077b74a7078ac509d79b024631a1"/><file name="emaildirect.css" hash="cba2c50e351f973a2463e92a91ec5569"/><file name="logo.png" hash="2e7e39ced387c798ef27b77dd69f073e"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="emaildirect"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="emaildirect.css" hash="5b2c8907468d0d5d013e30c6c5c8c9ed"/><file name="integration.js" hash="72ffc0716bc87ac2c92ba47784b5d33b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="9eb6f438b54472e217a9f8e99a8e117c"/></dir><dir name="template"><dir name="emaildirect"><dir name="abandoned"><file name="grid.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="c71edf8e0e270b4922020c0b010cc4c3"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="d2a91e7ba256fed67745ef1c284889cb"/><file name="orders.phtml" hash="7cc302d6bd638c111ca769ce2d23a1e1"/><file name="products.phtml" hash="b3e91d0fb47f26a3cc989f73f25a1e34"/></dir><dir name="signup"><file name="test.phtml" hash="636501cd90c6ab4231bea54efb16b2ff"/></dir><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="info.phtml" hash="19921a9ba4d9abd065ba7ab62e9946ce"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/><file name="trouble.phtml" hash="a6cbebe7956299a64c2f5ceab0c28651"/></dir></dir><file name="setup_check.phtml" hash="1814302f58a15fb1629446e074a7e1e0"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c829eeccb120ffe4c0b9f0ddf9c7ff9a"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="41dc4cc22f7a1c6fc9048bf936fb7953"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="c9e2c9493a2dad579bba4ed53795cf5e"/><file name="submit.phtml" hash="c2269f4a6a52d66bff5eac660d0831bd"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="view.phtml" hash="ee6af3fe79d916af764f41e7e8c5cc37"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="a2541c4b82ef33c791794344893c0f2d"/></dir><dir name="template"><dir name="emaildirect"><dir name="capture"><file name="email.phtml" hash="564c6130cd5f03bcff2ac8580e17bd2a"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="351ea790305f0a3ec99c34180bbee235"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="4256a03d67ec2a6f97867a87564cff92"/></dir><file name="lists.phtml" hash="4c697dcfa63ece1db7885cadb02982d1"/></dir></dir><dir name="signup"><file name="form.phtml" hash="4c7633e518f3374f722ccf22b51158da"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_emaildirect.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_emaildirect.html" hash="bd9f97e8f5485180d4420097b5200ef4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EmailDirect_Integration.xml" hash="90a441f2d0dff6c247f810274e8a76ab"/></dir></target></contents>
|
| 18 |
<compatible/>
|
| 19 |
<dependencies/>
|
| 20 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>EmailDirect_Integration</name>
|
| 4 |
+
<version>2.0.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license/>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>EmailDirect integration for magento</summary>
|
| 10 |
<description>EmailDirect integration for magento</description>
|
| 11 |
+
<notes>Configurable, Grouped and Bundle Product improvements.
|
| 12 |

|
| 13 |
+
Related Products Improvements.
|
| 14 |
+

|
| 15 |
+
Updates for custom checkouts.</notes>
|
| 16 |
<authors><author><name>Kevin Linden</name><user>auto-converted</user><email>Kevin@EmailDirect.com</email></author></authors>
|
| 17 |
+
<date>2014-05-23</date>
|
| 18 |
+
<time>04:12:59</time>
|
| 19 |
+
<contents><target name="magecommunity"><dir name="EmailDirect"><dir name="Integration"><dir name="Block"><dir name="Adminhtml"><dir name="Abandoned"><file name="Grid.php" hash="4a3f8d29d3d8feb13ae124297267ae85"/><file name="Status.php" hash="9a740fd8c63148532bbcf07d19f462df"/></dir><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Hint.php" hash="d01c241e1c4a42cd08f087ad784ed78e"/></dir><dir name="Form"><dir name="Field"><dir name="Export"><file name="Orders.php" hash="5b101fadb6a64044b276eb07b21cf0a5"/><file name="Products.php" hash="32e13d4b7250890bf84aba87f25de03c"/><file name="Range.php" hash="4adac96fa53fa8e1449bae943a8cca80"/></dir><dir name="Signup"><file name="Test.php" hash="3b773dda25c62bc8cb28031931d67f9f"/></dir><file name="Addressmapfields.php" hash="97b75c8340d561e863a3985ad73ce228"/><file name="Common.php" hash="6a86cce53f6df6857ea79241fa281939"/><file name="Info.php" hash="246de52ea5d2349ecd7f103cbba8cb8f"/><file name="Mapfields.php" hash="16894c5d76df1293e63128e349700e05"/><file name="Note.php" hash="ef99a474bbc3a828c7a618132a80fe66"/><file name="Shippingmapfields.php" hash="589a74260f394a5eae1b57ca89a74a8b"/><file name="Troubleshooting.php" hash="ff6b463004ab037031acea4a6f1d8517"/></dir></dir></dir><dir name="Convert"><dir name="Profile"><dir name="Export"><file name="Orders.php" hash="947af2b0d8e3f7bc47c47b32cd434f18"/><file name="Products.php" hash="3f93e4789dbeb6710cd2742587d61726"/></dir><file name="Export.php" hash="ba879607ac0693e9db6251bbbc1676a1"/></dir></dir></dir><dir name="Troubleshooting"><dir name="View"><dir name="Tab"><file name="Download.php" hash="619916677df7c833e559aae74dae2aa0"/><file name="Info.php" hash="4dad4b18e215d6df8c8e6631b4323b53"/><file name="Log.php" hash="d3dcb67ca284358eaa70db517637da87"/><file name="Submit.php" hash="fe896683680ab10ada6b67e0e803ccce"/></dir><file name="Form.php" hash="e527a3a2335b109c48a69f06c1b0d01f"/></dir><file name="Tabs.php" hash="ab1fdbe561e8572c2c50cdbec9573f82"/><file name="View.php" hash="b2d83536aade45e41039875db85b3018"/></dir><file name="Abandoned.php" hash="515b0c172e093341a2e69cb75570e553"/></dir><dir name="Checkout"><file name="Subscribe.php" hash="ae325e815a54bde93507562cf0d86b8a"/></dir><dir name="Customer"><dir name="Account"><dir name="Dashboard"><file name="Info.php" hash="20e74d9c2b2c02611c8f69b254d81ef5"/></dir><file name="Lists.php" hash="3c3bdb9482ecf4a71740a80395bd5465"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><dir name="Abandoned"><file name="Minutes.php" hash="e311f6de480fd4b63aee7f46ea412372"/></dir><file name="Action.php" hash="bf2243f50c9c6dafca26a5bcb889f372"/></dir></dir></dir></dir><file name="Capture.php" hash="b005beb856451f49178f2a6914fd5ae7"/><file name="Signup.php" hash="511c9376560cdc5f63b7dc00bdc205be"/></dir><dir name="Helper"><file name="Data.php" hash="e4c28346fa3ecbb373522c72a1c04d0b"/><file name="Fields.php" hash="a071611d146c1cbe453c9955c9251da0"/><file name="Upgrade.php" hash="407f12bce2c7c06c73a23d8ed853a038"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Abandoned"><file name="Collection.php" hash="5a64b4e8b672f80b4d9b6cc5a0d231eb"/></dir><dir name="Order"><file name="Collection.php" hash="43d343562cf7e54f1b36315aa5d1d4a7"/></dir><dir name="Session"><file name="Collection.php" hash="7d6a8283fdbc1207d709e2bbbc78906d"/></dir><file name="Abandoned.php" hash="485b3771906783d383de75ae9761e55c"/><file name="Order.php" hash="8d538a5737095a1ba0ad448c027b3afb"/><file name="Session.php" hash="516eeeb28038416dc885ed7af6a8a8b0"/></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Export"><file name="Batch.php" hash="96c51fc5c0b947750be4e612e32c83ab"/></dir><dir name="Send"><file name="Field.php" hash="8ecffa8ccce40f3b2db6513b24eb9200"/></dir><dir name="Signup"><file name="Opacity.php" hash="8eabed4c72e7347f0376c3d4cc1023a7"/><file name="Recurrence.php" hash="e11200bbc204b00486c373d8a4e6675e"/></dir><file name="Abandoned.php" hash="9881811b94f38be90bd20a99951a1903"/><file name="Abandonedlist.php" hash="66386003113d8589c9f3de4f03f538a8"/><file name="Additionallist.php" hash="254081820d07a8754a71743ea58a7af4"/><file name="Checkoutsubscribe.php" hash="fd90252a1f19649a420dae136ad2a2ba"/><file name="List.php" hash="d76e36c0198e509a63c663e827cc7940"/><file name="Publication.php" hash="635fae1c20981c0ca7b90007a00e99a7"/><file name="Sequence.php" hash="ec9718c2b5dc35c559e5c09e345eff88"/><file name="Source.php" hash="f3c246959c74f6d378f3e2d7b8148d7f"/><file name="States.php" hash="a746affc786d8165a98801e68cbf80ab"/><file name="Statuses.php" hash="9844a7a9c3b5c68df45c8f6c518acf16"/><file name="Time.php" hash="8acbb5cb33e66de1e408cf55d17a9398"/></dir></dir></dir><dir name="Wrapper"><file name="Abandoned.php" hash="ef81d36a7276737f2d0aa1a5d783a83b"/><file name="Abstract.php" hash="9e97ce6a12e0d074921bb3a1391f3648"/><file name="Database.php" hash="3cceb467358d13584baff58c043762ec"/><file name="Execute.php" hash="5a339e0a5407cf05b161102fc65595bb"/><file name="Ftp.php" hash="d5335cfb68f99761d6902dd390a3d7a8"/><file name="Lists.php" hash="425d64b9256bbdbafa899c4138e78368"/><file name="Orders.php" hash="86b67096652aef21711c41e1992f4fbe"/><file name="Publications.php" hash="815715549df345ccb5b69ed65589aa53"/><file name="Sources.php" hash="c6caf0274f7d0c50114324bc47a490c4"/><file name="Subscribers.php" hash="1761d56b33e62b809ba7d380655d1d43"/></dir><file name="Abandoned.php" hash="93bd43b59b143dec15858a6fba6ae568"/><file name="Observer.php" hash="678bc7fed14d0b94a79d7627a4b0b4b7"/><file name="Order.php" hash="b21426543cd46f799cd0743525120fb8"/><file name="Session.php" hash="c56ecf779dbfb2dae0030935af31911a"/></dir><dir name="controllers"><dir name="Admin"><file name="AbandonedController.php" hash="04be2181a65e505084b324188f1fd64d"/><file name="ExportController.php" hash="e4d3eb0b3a9ef9f3caa0146debc256bc"/><file name="TroubleshootingController.php" hash="3de9950849e08648d8872aea4760c992"/></dir><dir name="Customer"><file name="AccountController.php" hash="ae75c37519f8d9f671509ff9b7fb34a4"/></dir><file name="AbandonedController.php" hash="b2874c7fcde989dc6f7ccff4a25f5563"/><file name="CaptureController.php" hash="89e043bb3864617a062e915d2209dcf4"/><file name="ExportController.php" hash="7ca147debc5c1436b3bf2d9501592f33"/></dir><dir name="etc"><file name="adminhtml.xml" hash="26c4aa6d38306846a585166d6602b305"/><file name="config.xml" hash="7e0f193f12243b256e1f594b244d20cf"/><file name="system.xml" hash="115ba31309c00a99a924dc2862ac23f0"/></dir><dir name="sql"><dir name="emaildirect_setup"><file name="mysql4-install-2.0.0.php" hash="2ab06feda5e6ee37e8e5006921852f8f"/><file name="mysql4-upgrade-1.5.8-2.0.0.php" hash="20b98743a4ac747d90fec22ff4fbbe10"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="emaildirect"><file name="emaildirect-tab.png" hash="9ddb077b74a7078ac509d79b024631a1"/><file name="emaildirect.css" hash="cba2c50e351f973a2463e92a91ec5569"/><file name="logo.png" hash="2e7e39ced387c798ef27b77dd69f073e"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="emaildirect"><dir name="images"><file name="window_close.png" hash="3af14f053f360bf31f8ba2df73ec7f1e"/></dir><file name="emaildirect.css" hash="5b2c8907468d0d5d013e30c6c5c8c9ed"/><file name="integration.js" hash="72ffc0716bc87ac2c92ba47784b5d33b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="9eb6f438b54472e217a9f8e99a8e117c"/></dir><dir name="template"><dir name="emaildirect"><dir name="abandoned"><file name="grid.phtml" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="status.phtml" hash="9e7723dc1fe5f8693345db9cc7cda808"/></dir><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="f64073616c5807d5ea32a13cc008ef4d"/></dir><dir name="form"><dir name="field"><dir name="export"><file name="date_range.phtml" hash="d2a91e7ba256fed67745ef1c284889cb"/><file name="orders.phtml" hash="7cc302d6bd638c111ca769ce2d23a1e1"/><file name="products.phtml" hash="b3e91d0fb47f26a3cc989f73f25a1e34"/></dir><dir name="signup"><file name="test.phtml" hash="636501cd90c6ab4231bea54efb16b2ff"/></dir><file name="array.phtml" hash="5415eeff311735624354468c886d39b5"/><file name="info.phtml" hash="19921a9ba4d9abd065ba7ab62e9946ce"/><file name="note.phtml" hash="6625a3771ba10daba5ded5570574716f"/><file name="trouble.phtml" hash="a6cbebe7956299a64c2f5ceab0c28651"/></dir></dir><file name="setup_check.phtml" hash="1814302f58a15fb1629446e074a7e1e0"/></dir><dir name="convert"><dir name="profile"><file name="export.phtml" hash="c829eeccb120ffe4c0b9f0ddf9c7ff9a"/></dir></dir></dir><dir name="troubleshooting"><dir name="view"><dir name="tab"><file name="download.phtml" hash="41dc4cc22f7a1c6fc9048bf936fb7953"/><file name="info.phtml" hash="bd19bb1072ce1d60a4fb7bda660a0ce7"/><file name="log.phtml" hash="c9e2c9493a2dad579bba4ed53795cf5e"/><file name="submit.phtml" hash="c2269f4a6a52d66bff5eac660d0831bd"/></dir><file name="form.phtml" hash="d2338bfe3598e9315ca8f5ac8d9b5516"/></dir><file name="view.phtml" hash="ee6af3fe79d916af764f41e7e8c5cc37"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="emaildirect.xml" hash="a2541c4b82ef33c791794344893c0f2d"/></dir><dir name="template"><dir name="emaildirect"><dir name="capture"><file name="email.phtml" hash="564c6130cd5f03bcff2ac8580e17bd2a"/></dir><dir name="checkout"><file name="subscribe.phtml" hash="d57eb93aab4e0f1d58f1ec8b9ed24c50"/></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="fb89b2a726be35932de32ec9417ba81a"/></dir><file name="lists.phtml" hash="4c697dcfa63ece1db7885cadb02982d1"/></dir></dir><dir name="signup"><file name="form.phtml" hash="4c7633e518f3374f722ccf22b51158da"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="newsletter_subscr_success_emaildirect.html" hash="f6afb69d207bbc3f8920e7a72ac9dd07"/><file name="newsletter_unsub_success_emaildirect.html" hash="bd9f97e8f5485180d4420097b5200ef4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="EmailDirect_Integration.xml" hash="90a441f2d0dff6c247f810274e8a76ab"/></dir></target></contents>
|
| 20 |
<compatible/>
|
| 21 |
<dependencies/>
|
| 22 |
</package>
|
