edroneCRM - Version 1.0.3

Version Notes

edrone magento module - initial public release

Download this release

Release Info

Developer Michał Blak
Extension edroneCRM
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/local/Edrone/Base/Block/Base.php CHANGED
@@ -2,22 +2,22 @@
2
 
3
  class Edrone_Base_Block_Base extends Mage_Core_Block_Template
4
  {
5
- const CUSTOMER_DATA_KEY = 'customerData';
6
 
7
  /**
8
  * @var Edrone_Base_Helper_Config
9
  */
10
- private $helper;
11
 
12
  /**
13
  * @var array
14
  */
15
  protected $customerData = array();
16
 
17
- public function __construct()
18
  {
19
- $this->helper = Mage::helper('edrone/config');
20
- $this->customerData = Mage::registry(self::CUSTOMER_DATA_KEY);
 
21
  }
22
 
23
  /**
@@ -25,7 +25,7 @@ class Edrone_Base_Block_Base extends Mage_Core_Block_Template
25
  */
26
  public function getConfigHelper()
27
  {
28
- return $this->helper;
29
  }
30
 
31
  /**
@@ -33,14 +33,12 @@ class Edrone_Base_Block_Base extends Mage_Core_Block_Template
33
  */
34
  public function getCustomerData()
35
  {
36
- if (empty($this->customerData)) {
37
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
38
  $this->getLoggedCustomerData();
39
  } else {
40
  $this->getGuestCustomerData();
41
  }
42
-
43
- Mage::register(self::CUSTOMER_DATA_KEY, $this->customerData);
44
  }
45
 
46
  return $this->customerData;
@@ -63,6 +61,8 @@ class Edrone_Base_Block_Base extends Mage_Core_Block_Template
63
  $this->customerData['city'] = '';
64
  $this->customerData['phone'] = '';
65
  }
 
 
66
  }
67
 
68
  private function getGuestCustomerData()
@@ -73,5 +73,21 @@ class Edrone_Base_Block_Base extends Mage_Core_Block_Template
73
  $this->customerData['country'] = '';
74
  $this->customerData['city'] = '';
75
  $this->customerData['phone'] = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
  }
2
 
3
  class Edrone_Base_Block_Base extends Mage_Core_Block_Template
4
  {
 
5
 
6
  /**
7
  * @var Edrone_Base_Helper_Config
8
  */
9
+ private $configHelper;
10
 
11
  /**
12
  * @var array
13
  */
14
  protected $customerData = array();
15
 
16
+ public function _construct()
17
  {
18
+ parent::_construct();
19
+
20
+ $this->configHelper = Mage::helper('edrone/config');
21
  }
22
 
23
  /**
25
  */
26
  public function getConfigHelper()
27
  {
28
+ return $this->configHelper;
29
  }
30
 
31
  /**
33
  */
34
  public function getCustomerData()
35
  {
36
+ if(!count($this->customerData)) {
37
  if (Mage::getSingleton('customer/session')->isLoggedIn()) {
38
  $this->getLoggedCustomerData();
39
  } else {
40
  $this->getGuestCustomerData();
41
  }
 
 
42
  }
43
 
44
  return $this->customerData;
61
  $this->customerData['city'] = '';
62
  $this->customerData['phone'] = '';
63
  }
64
+
65
+ $this->customerData['is_logged_in'] = 1;
66
  }
67
 
68
  private function getGuestCustomerData()
73
  $this->customerData['country'] = '';
74
  $this->customerData['city'] = '';
75
  $this->customerData['phone'] = '';
76
+
77
+ $quote = Mage::getModel('checkout/cart')->getQuote();
78
+ $address = $quote->getBillingAddress();
79
+
80
+ if($address) {
81
+ $this->customerData['first_name'] = $address->getFirstname();
82
+ $this->customerData['last_name'] = $address->getFirstname();
83
+ $this->customerData['email'] = $address->getFirstname();
84
+ $this->customerData['country'] = $address->getFirstname();
85
+ $this->customerData['city'] = $address->getFirstname();
86
+ $this->customerData['phone'] = $address->getTelephone();
87
+ }
88
+
89
+ $this->customerData['is_logged_in'] = 0;
90
+
91
+
92
  }
93
  }
app/code/local/Edrone/Base/Block/Order.php CHANGED
@@ -15,7 +15,9 @@ class Edrone_Base_Block_Order extends Edrone_Base_Block_Base
15
  foreach ($order->getAllVisibleItems() as $item) {
16
  $skus[] = $item->getSku();
17
  $titles[] = $item->getName();
18
- $images[] = (string)Mage::helper('catalog/image')->init($item->getProduct(), 'image')->resize(438);
 
 
19
  }
20
 
21
  $orderData['sku'] = join('|', $skus);
@@ -36,7 +38,6 @@ class Edrone_Base_Block_Order extends Edrone_Base_Block_Base
36
  {
37
  parent::getCustomerData();
38
 
39
- if (empty($this->customerData['first_name'])) {
40
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
41
  $order = Mage::getModel('sales/order')->load($lastOrderId);
42
 
@@ -45,7 +46,7 @@ class Edrone_Base_Block_Order extends Edrone_Base_Block_Base
45
  $this->customerData['email'] = $order->getBillingAddress()->getEmail();
46
  $this->customerData['country'] = $order->getBillingAddress()->getCountry();
47
  $this->customerData['city'] = $order->getBillingAddress()->getCity();
48
- }
49
 
50
  return $this->customerData;
51
  }
15
  foreach ($order->getAllVisibleItems() as $item) {
16
  $skus[] = $item->getSku();
17
  $titles[] = $item->getName();
18
+
19
+ $product = $item->getProduct();
20
+ if ($product) $images[] = (string)Mage::helper('catalog/image')->init($product, 'image')->resize(438);
21
  }
22
 
23
  $orderData['sku'] = join('|', $skus);
38
  {
39
  parent::getCustomerData();
40
 
 
41
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
42
  $order = Mage::getModel('sales/order')->load($lastOrderId);
43
 
46
  $this->customerData['email'] = $order->getBillingAddress()->getEmail();
47
  $this->customerData['country'] = $order->getBillingAddress()->getCountry();
48
  $this->customerData['city'] = $order->getBillingAddress()->getCity();
49
+ $this->customerData['phone'] = $order->getBillingAddress()->getTelephone();
50
 
51
  return $this->customerData;
52
  }
app/code/local/Edrone/Base/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Edrone_Base>
5
- <version>1.0.1</version>
6
  </Edrone_Base>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Edrone_Base>
5
+ <version>1.0.3</version>
6
  </Edrone_Base>
7
  </modules>
8
  <global>
app/design/frontend/base/default/layout/edrone.xml CHANGED
@@ -26,4 +26,10 @@
26
  <block type="edrone/order" name="edrone" template="edrone/success_view.phtml"/>
27
  </reference>
28
  </checkout_onepage_success>
 
 
 
 
 
 
29
  </layout>
26
  <block type="edrone/order" name="edrone" template="edrone/success_view.phtml"/>
27
  </reference>
28
  </checkout_onepage_success>
29
+
30
+ <checkout_onepage_index>
31
+ <reference name="head">
32
+ <action method="addJs"><script>edrone/edrone.js</script></action>
33
+ </reference>
34
+ </checkout_onepage_index>
35
  </layout>
app/design/frontend/base/default/template/edrone/cart_view.phtml CHANGED
@@ -10,8 +10,10 @@ $productData = $this->getProductData();
10
  (function (srcjs) {
11
  window._edrone = window._edrone || {};
12
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
13
- _edrone.version = '2.4';
 
14
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
 
15
  _edrone.email = '<?php echo $customerData['email'] ?>';
16
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
17
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
10
  (function (srcjs) {
11
  window._edrone = window._edrone || {};
12
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
13
+ _edrone.version = '1.0.3';
14
+ _edrone.platform_version = '<?php echo Mage::getVersion(); ?>';
15
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
16
+ _edrone.is_logged_in = '<?php echo $customerData['is_logged_in'] ?>';
17
  _edrone.email = '<?php echo $customerData['email'] ?>';
18
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
19
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
app/design/frontend/base/default/template/edrone/default.phtml CHANGED
@@ -8,8 +8,10 @@ $customerData = $this->getCustomerData();
8
  (function (srcjs) {
9
  window._edrone = window._edrone || {};
10
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
11
- _edrone.version = '2.4';
 
12
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
 
13
  _edrone.email = '<?php echo $customerData['email'] ?>';
14
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
15
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
8
  (function (srcjs) {
9
  window._edrone = window._edrone || {};
10
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
11
+ _edrone.version = '1.0.3';
12
+ _edrone.platform_version = '<?php echo Mage::getVersion(); ?>';
13
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
14
+ _edrone.is_logged_in = '<?php echo $customerData['is_logged_in'] ?>';
15
  _edrone.email = '<?php echo $customerData['email'] ?>';
16
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
17
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
app/design/frontend/base/default/template/edrone/product_view.phtml CHANGED
@@ -9,8 +9,10 @@ $productData = $this->getProductData();
9
  (function (srcjs) {
10
  window._edrone = window._edrone || {};
11
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
12
- _edrone.version = '2.4';
 
13
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
 
14
  _edrone.email = '<?php echo $customerData['email'] ?>';
15
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
16
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
9
  (function (srcjs) {
10
  window._edrone = window._edrone || {};
11
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
12
+ _edrone.version = '1.0.3';
13
+ _edrone.platform_version = '<?php echo Mage::getVersion(); ?>';
14
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
15
+ _edrone.is_logged_in = '<?php echo $customerData['is_logged_in'] ?>';
16
  _edrone.email = '<?php echo $customerData['email'] ?>';
17
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
18
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
app/design/frontend/base/default/template/edrone/success_view.phtml CHANGED
@@ -10,8 +10,10 @@ $orderData = $this->getOrderData();
10
  (function (srcjs) {
11
  window._edrone = window._edrone || {};
12
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
13
- _edrone.version = '2.4';
 
14
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
 
15
  _edrone.email = '<?php echo $customerData['email'] ?>';
16
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
17
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
@@ -29,6 +31,7 @@ $orderData = $this->getOrderData();
29
  _edrone.country = '<?php echo $customerData['country'] ?>';
30
  _edrone.city = '<?php echo $customerData['city'] ?>';
31
 
 
32
  var doc = document.createElement('script');
33
  doc.type = 'text/javascript';
34
  doc.async = true;
10
  (function (srcjs) {
11
  window._edrone = window._edrone || {};
12
  _edrone.app_id = '<?php echo $helper->getAppId() ?>';
13
+ _edrone.version = '1.0.3';
14
+ _edrone.platform_version = '<?php echo Mage::getVersion(); ?>';
15
  _edrone.trace_url = '<?php echo $helper->getCollectorUrl() ?>';
16
+ _edrone.is_logged_in = '<?php echo $customerData['is_logged_in'] ?>';
17
  _edrone.email = '<?php echo $customerData['email'] ?>';
18
  _edrone.phone = '<?php echo $customerData['phone'] ?>';
19
  _edrone.first_name = '<?php echo $customerData['first_name'] ?>';
31
  _edrone.country = '<?php echo $customerData['country'] ?>';
32
  _edrone.city = '<?php echo $customerData['city'] ?>';
33
 
34
+
35
  var doc = document.createElement('script');
36
  doc.type = 'text/javascript';
37
  doc.async = true;
app/etc/modules/Edrone_Base.xml CHANGED
@@ -6,4 +6,4 @@
6
  <codePool>local</codePool>
7
  </Edrone_Base>
8
  </modules>
9
- </config>
6
  <codePool>local</codePool>
7
  </Edrone_Base>
8
  </modules>
9
+ </config>
app/locale/pl_PL/Edrone.csv DELETED
@@ -1,2 +0,0 @@
1
- "External JS script address","Adres zewnętrznego skryptu JS"
2
- "Collector script address","Adres skryptu kolektora"
 
 
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>edroneCRM</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>edrone - first CRM for e-commerce Maintain clients &amp; increase customer retention with dynamic e-CRM.</summary>
10
  <description>edrone is collecting and analyzing Magento visitors and customers data. The plugin allows processing personal data in the real-time in order to communicate with them through dynamic and personalized e-mail.</description>
11
  <notes>edrone magento module - initial public release</notes>
12
  <authors><author><name>Micha&#x142; Blak</name><user>MAG002993376</user><email>michalblak@gmail.com</email></author></authors>
13
- <date>2015-07-30</date>
14
- <time>07:30:07</time>
15
- <contents><target name="magelocal"><dir name="Edrone"><dir name="Base"><dir name="Block"><file name="Base.php" hash="c3fa1d3e32111ad7eef177904f2574dc"/><file name="Cart.php" hash="ed49bc87f960039570aa016c7c0fae6a"/><file name="Order.php" hash="ccc388d5210fc55c05ed320d8d0f4738"/><file name="Product.php" hash="174503941cc8dbabddf875a4001bc6fd"/></dir><dir name="Helper"><file name="Config.php" hash="5b0ffff08d4f2c8a3dfd08837732d776"/><file name="Data.php" hash="bd4dcfb429a76044eb2dab3958b89b15"/></dir><dir name="Model"><file name="Observer.php" hash="f35c3bf591865d6db22e2477580df76c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e715e76c00295dc4e555411455fedfb"/><file name="config.xml" hash="800f2853c0c6b2f359687fff825e0efc"/><file name="system.xml" hash="08dd398842eb30b924f224ac4aa4609d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="edrone"><file name="cart_view.phtml" hash="d403b1800d07b7347038726e9330a586"/><file name="default.phtml" hash="654fc889086ace8ae9ad875e18b35a8a"/><file name="product_view.phtml" hash="1c6049097f37d1e3d9d46395107e4fbc"/><file name="success_view.phtml" hash="e19868d5a413a225f51e27cbbae90d4d"/></dir></dir><dir name="layout"><file name="edrone.xml" hash="b08f6069d1a9a10c6e32a9757f9bc4cf"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Edrone_Base.xml" hash="4c5f7b0e7d7ab7ba79395f08d76f2f74"/></dir></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Edrone.csv" hash="b8aa59d39815f4d92738129cc9fbdf34"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>edroneCRM</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Edrone - first CRM for e-commerce Maintain clients &amp; increase customer retention with dynamic e-CRM.</summary>
10
  <description>edrone is collecting and analyzing Magento visitors and customers data. The plugin allows processing personal data in the real-time in order to communicate with them through dynamic and personalized e-mail.</description>
11
  <notes>edrone magento module - initial public release</notes>
12
  <authors><author><name>Micha&#x142; Blak</name><user>MAG002993376</user><email>michalblak@gmail.com</email></author></authors>
13
+ <date>2015-08-13</date>
14
+ <time>14:04:03</time>
15
+ <contents><target name="magelocal"><dir name="Edrone"><dir name="Base"><dir name="Block"><file name="Base.php" hash="e1c328aee3e704903012822cd4543623"/><file name="Cart.php" hash="ed49bc87f960039570aa016c7c0fae6a"/><file name="Order.php" hash="cf657aa6f6092ae82ae076a4e50ae5fe"/><file name="Product.php" hash="174503941cc8dbabddf875a4001bc6fd"/></dir><dir name="Helper"><file name="Config.php" hash="5b0ffff08d4f2c8a3dfd08837732d776"/><file name="Data.php" hash="bd4dcfb429a76044eb2dab3958b89b15"/></dir><dir name="Model"><file name="Observer.php" hash="f35c3bf591865d6db22e2477580df76c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0e715e76c00295dc4e555411455fedfb"/><file name="config.xml" hash="dc0c7f9637c94dde526d087286796516"/><file name="system.xml" hash="08dd398842eb30b924f224ac4aa4609d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="edrone"><file name="cart_view.phtml" hash="643016a1ecf1218dbb357f343b3eb638"/><file name="default.phtml" hash="a97d6bf566d768300e3e662bbc79bec1"/><file name="product_view.phtml" hash="248c6b4a4d7b259df0ce2dc0d9aaa95a"/><file name="success_view.phtml" hash="d3b2fdcf18e0de84061e0d35eb69728c"/></dir></dir><dir name="layout"><file name="edrone.xml" hash="48e37d1c01507337f8dc33eb9e03af34"/></dir></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Edrone_Base.xml" hash="29d3699c3a83fa4fea848a6cb7800872"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>