Hellodialog_Tracker - Version 2.0.1

Version Notes

This plugin connects your Magento shop to Hellodialog. Your customers will automatically be subscribed to your Hellodialog account.
Optionally use the Hellodialog eCommerce Plugin to target groups of customers based on their purchase history.

Release 2.0.1 contains a number of fixes, as well as an update to the underlying API domain used.

Release 2.0.0 was completely rebuilt from scratch. The most important changes:
- Made the importing of orders with customers optional
- Fieldmapping: specify which Magento fields to import into Hellodialog
- Synchronize history of all completed orders

For any questions or when you need help installing our extension, please contact us at support@hellodialog.com or call us at +31 23 53 22 608.

Download this release

Release Info

Developer Maarten van Schalkwijk
Extension Hellodialog_Tracker
Version 2.0.1
Comparing to
See all releases


Code changes from version 2.0.0 to 2.0.1

app/code/community/Hellodialog/Tracker/Model/HDApi.php CHANGED
@@ -91,7 +91,7 @@ class HDApi {
91
 
92
  $curl = curl_init();
93
 
94
- $requestUrl = 'https://app.klantenbinder2.nl/api/'.$this->_url;
95
 
96
  if(!is_null($id)){
97
  $requestUrl .= '/'.$id;
91
 
92
  $curl = curl_init();
93
 
94
+ $requestUrl = 'https://app.hellodialog.com/api/'.$this->_url;
95
 
96
  if(!is_null($id)){
97
  $requestUrl .= '/'.$id;
app/code/community/Hellodialog/Tracker/Model/Observer.php CHANGED
@@ -73,7 +73,9 @@
73
  // ... add hardcoded required field: email
74
  $mapping[] = array('magento' => 'email', 'hellodialog' => 'email');
75
  foreach ($mapping as $map) {
76
- $contact[$map['hellodialog']] = $this->_value($map['magento']);
 
 
77
  }
78
  }
79
 
@@ -243,34 +245,39 @@
243
 
244
  if (Mage::getStoreConfig('hellodialog/general/ecommerce')) {
245
 
 
 
246
  //HD Ecommerce
247
  $HDEcommerce = new HDEcommerce();
248
- $HDEcommerce->addOrder($this->_createHellodialogOrder(), $this->_value('email'));
249
- $HDEcommerce->setContactData($contact, $this->_value('email'), true);
 
 
 
 
 
 
250
 
251
  // retrieve all items in this order
252
  $items = $this->_order->getAllVisibleItems();
253
 
254
  foreach ($items as $item){
255
- $HDEcommerce->addProduct(array(
256
- 'product_code' => $item->getSku(),
257
- 'name' => $item->getName(),
258
- 'quantity' => $item->getQty(),
259
- 'price' => $item->getPrice(),
260
- 'discount' => $item->getDiscountAmount(),
261
- ), $this->_value('id'));
 
 
 
 
262
  }
263
 
264
- $success = true;
265
  try {
266
- Mage::log("eCommerce plugin enabled: posting order to Hellodialog", null, 'hellodialog.log');
267
  $ordersResult = $HDEcommerce->postOrders();
268
- } catch (Exception $e) {
269
- $success = false;
270
- Mage::log("... FAILED (error while creating order: duplicate or other error)", null, 'hellodialog.log');
271
- }
272
 
273
- if ($success) {
274
  if (is_object($ordersResult) && isset($ordersResult->result) && is_object($ordersResult->result) && isset($ordersResult->result->code)) {
275
  if ($ordersResult->result->code == '200') {
276
  Mage::log("... OK (Orders created)", null, 'hellodialog.log');
@@ -280,8 +287,9 @@
280
  } else {
281
  Mage::log("... FAILED (unexpected response)", null, 'hellodialog.log');
282
  }
 
 
283
  }
284
-
285
  } else {
286
  Mage::log("eCommerce plugin disabled: not posting order to Hellodialog", null, 'hellodialog.log');
287
  }
73
  // ... add hardcoded required field: email
74
  $mapping[] = array('magento' => 'email', 'hellodialog' => 'email');
75
  foreach ($mapping as $map) {
76
+ if (isset($map['hellodialog'])) {
77
+ $contact[$map['hellodialog']] = $this->_value($map['magento']);
78
+ }
79
  }
80
  }
81
 
245
 
246
  if (Mage::getStoreConfig('hellodialog/general/ecommerce')) {
247
 
248
+ Mage::log("eCommerce plugin enabled: posting order to Hellodialog", null, 'hellodialog.log');
249
+
250
  //HD Ecommerce
251
  $HDEcommerce = new HDEcommerce();
252
+
253
+ try {
254
+ $HDEcommerce->addOrder($this->_createHellodialogOrder(), $this->_value('email'));
255
+ $HDEcommerce->setContactData($contact, $this->_value('email'), true);
256
+ } catch (Exception $e) {
257
+ Mage::log("... ERROR setting up HDEcommerce class with order and contact data (".$e->getMessage().")", null, 'hellodialog.log');
258
+ return;
259
+ }
260
 
261
  // retrieve all items in this order
262
  $items = $this->_order->getAllVisibleItems();
263
 
264
  foreach ($items as $item){
265
+ try {
266
+ $HDEcommerce->addProduct(array(
267
+ 'product_code' => $item->getSku(),
268
+ 'name' => $item->getName(),
269
+ 'quantity' => $item->getQty(),
270
+ 'price' => $item->getPrice(),
271
+ 'discount' => $item->getDiscountAmount(),
272
+ ), $this->_value('id'));
273
+ } catch (Exception $e) {
274
+ Mage::log("... SKIPPING product because it throws an error (".$e->getMessage().")", null, 'hellodialog.log');
275
+ }
276
  }
277
 
 
278
  try {
 
279
  $ordersResult = $HDEcommerce->postOrders();
 
 
 
 
280
 
 
281
  if (is_object($ordersResult) && isset($ordersResult->result) && is_object($ordersResult->result) && isset($ordersResult->result->code)) {
282
  if ($ordersResult->result->code == '200') {
283
  Mage::log("... OK (Orders created)", null, 'hellodialog.log');
287
  } else {
288
  Mage::log("... FAILED (unexpected response)", null, 'hellodialog.log');
289
  }
290
+ } catch (Exception $e) {
291
+ Mage::log("... FAILED (error while creating order: duplicate or other error)", null, 'hellodialog.log');
292
  }
 
293
  } else {
294
  Mage::log("eCommerce plugin disabled: not posting order to Hellodialog", null, 'hellodialog.log');
295
  }
app/code/community/Hellodialog/Tracker/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
 
4
  <modules>
5
  <Hellodialog_Tracker>
6
- <version>2.0.0</version>
7
  </Hellodialog_Tracker>
8
  </modules>
9
 
3
 
4
  <modules>
5
  <Hellodialog_Tracker>
6
+ <version>2.0.1</version>
7
  </Hellodialog_Tracker>
8
  </modules>
9
 
app/code/community/Hellodialog/Tracker/etc/system.xml CHANGED
@@ -17,7 +17,7 @@
17
  <show_in_store>1</show_in_store>
18
  <groups>
19
  <general>
20
- <label>Hellodialog Magento plugin v2.0.0</label>
21
  <frontend_type>text</frontend_type>
22
  <sort_order>1</sort_order>
23
  <show_in_default>1</show_in_default>
@@ -28,7 +28,7 @@
28
  <![CDATA[
29
  <img src='http://www.hellodialog.com/img/magento_plugin_assets/logo.png' style='float: left; width: 100px;'/>
30
  <div style='margin-left: 130px; padding-top: 6px; line-height: 25px;'>
31
- <strong>Hellodialog Magento Plugin v2.0.0</strong><br/>
32
  This plugin connects your Magento shop to Hellodialog. Your customers will automatically be subscribed to your Hellodialog account.
33
  <br/>
34
  Optionally use the Hellodialog eCommerce Plugin to target groups of customers based on their purchase history.
@@ -42,7 +42,7 @@
42
  <apikey>
43
  <label>API Key</label>
44
  <comment>
45
- <![CDATA[Please enter your Hellodialog API Key.<br/><a target='_blank' href='https://app.klantenbinder2.nl/settings/api'>Where do I find my API key?</a>]]>
46
  </comment>
47
  <frontend_type>text</frontend_type>
48
  <sort_order>2</sort_order>
17
  <show_in_store>1</show_in_store>
18
  <groups>
19
  <general>
20
+ <label>Hellodialog Magento plugin v2.0.1</label>
21
  <frontend_type>text</frontend_type>
22
  <sort_order>1</sort_order>
23
  <show_in_default>1</show_in_default>
28
  <![CDATA[
29
  <img src='http://www.hellodialog.com/img/magento_plugin_assets/logo.png' style='float: left; width: 100px;'/>
30
  <div style='margin-left: 130px; padding-top: 6px; line-height: 25px;'>
31
+ <strong>Hellodialog Magento Plugin v2.0.1</strong><br/>
32
  This plugin connects your Magento shop to Hellodialog. Your customers will automatically be subscribed to your Hellodialog account.
33
  <br/>
34
  Optionally use the Hellodialog eCommerce Plugin to target groups of customers based on their purchase history.
42
  <apikey>
43
  <label>API Key</label>
44
  <comment>
45
+ <![CDATA[Please enter your Hellodialog API Key.<br/><a target='_blank' href='https://app.hellodialog.com/settings/api'>Where do I find my API key?</a>]]>
46
  </comment>
47
  <frontend_type>text</frontend_type>
48
  <sort_order>2</sort_order>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Hellodialog_Tracker</name>
4
- <version>2.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -13,16 +13,18 @@ Optionally use the Hellodialog eCommerce Plugin to target groups of customers ba
13
  <notes>This plugin connects your Magento shop to Hellodialog. Your customers will automatically be subscribed to your Hellodialog account.&#xD;
14
  Optionally use the Hellodialog eCommerce Plugin to target groups of customers based on their purchase history.&#xD;
15
  &#xD;
 
 
16
  Release 2.0.0 was completely rebuilt from scratch. The most important changes:&#xD;
17
  - Made the importing of orders with customers optional&#xD;
18
  - Fieldmapping: specify which Magento fields to import into Hellodialog&#xD;
19
  - Synchronize history of all completed orders&#xD;
20
  &#xD;
21
- For any questions or when you need help installing our extension, please contact us at support@hellodialog.com or call us +31 23 53 22 608.</notes>
22
  <authors><author><name>Maarten van Schalkwijk</name><user>Hellodialog</user><email>maarten@hellodialog.com</email></author></authors>
23
- <date>2015-03-06</date>
24
- <time>14:02:41</time>
25
- <contents><target name="magecommunity"><dir name="Hellodialog"><dir name="Tracker"><dir name="Block"><file name="Cronprogress.php" hash="48122f9d7a8b3f01224a0750b68ff67e"/><file name="Fieldmapping.php" hash="1cd6e6e1b7e473cf8649f567f5e04f90"/><file name="Syncstatus.php" hash="88c1fd5d5e4dc4a7cb0c226a2ba9c958"/><file name="Validator.php" hash="beb1c17c3817b44e1078b1bec0d8ceef"/></dir><dir name="Model"><file name="APIKeyValidator.php" hash="ef82d2001f97ce4203d5717c770ddd82"/><file name="Cron.php" hash="b80aaa48269070e2d35738c80a95d2ee"/><file name="HDApi.php" hash="b65fb0c133b6e44b4732851f58d00beb"/><file name="HDEcommerce.php" hash="cb58ce227b74924968f81945fe4a2c82"/><file name="Observer.php" hash="3e8aee9152e074503b3dd281546dd6ef"/><file name="SubscribeOptions.php" hash="dc700ecb157f1ead9300eb441e0d190d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FormController.php" hash="74e25b46ad18817d305550bb82aacc26"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="12c5102eab80f7c17d0032a50cf96478"/><file name="config.xml" hash="37def834bedbf222dbb3d97f8aaaa889"/><file name="system.xml" hash="32aba8e356d77ccfb249e593b641f32e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hellodialog_Tracker.xml" hash="7d32b9c31228e1c1709f05642bed18d2"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Hellodialog_Tracker</name>
4
+ <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</license>
7
  <channel>community</channel>
13
  <notes>This plugin connects your Magento shop to Hellodialog. Your customers will automatically be subscribed to your Hellodialog account.&#xD;
14
  Optionally use the Hellodialog eCommerce Plugin to target groups of customers based on their purchase history.&#xD;
15
  &#xD;
16
+ Release 2.0.1 contains a number of fixes, as well as an update to the underlying API domain used.&#xD;
17
+ &#xD;
18
  Release 2.0.0 was completely rebuilt from scratch. The most important changes:&#xD;
19
  - Made the importing of orders with customers optional&#xD;
20
  - Fieldmapping: specify which Magento fields to import into Hellodialog&#xD;
21
  - Synchronize history of all completed orders&#xD;
22
  &#xD;
23
+ For any questions or when you need help installing our extension, please contact us at support@hellodialog.com or call us at +31 23 53 22 608.</notes>
24
  <authors><author><name>Maarten van Schalkwijk</name><user>Hellodialog</user><email>maarten@hellodialog.com</email></author></authors>
25
+ <date>2015-12-07</date>
26
+ <time>10:40:11</time>
27
+ <contents><target name="magecommunity"><dir name="Hellodialog"><dir name="Tracker"><dir name="Block"><file name="Cronprogress.php" hash="48122f9d7a8b3f01224a0750b68ff67e"/><file name="Fieldmapping.php" hash="1cd6e6e1b7e473cf8649f567f5e04f90"/><file name="Syncstatus.php" hash="88c1fd5d5e4dc4a7cb0c226a2ba9c958"/><file name="Validator.php" hash="beb1c17c3817b44e1078b1bec0d8ceef"/></dir><dir name="Model"><file name="APIKeyValidator.php" hash="ef82d2001f97ce4203d5717c770ddd82"/><file name="Cron.php" hash="b80aaa48269070e2d35738c80a95d2ee"/><file name="HDApi.php" hash="29b9432cb6fcb9ea9cf4a4244aef569f"/><file name="HDEcommerce.php" hash="cb58ce227b74924968f81945fe4a2c82"/><file name="Observer.php" hash="b853135ae79d2a3c92eebc45cd23d359"/><file name="SubscribeOptions.php" hash="dc700ecb157f1ead9300eb441e0d190d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="FormController.php" hash="74e25b46ad18817d305550bb82aacc26"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="12c5102eab80f7c17d0032a50cf96478"/><file name="config.xml" hash="743d53a013b7f869f941b0dae3bb8063"/><file name="system.xml" hash="0ac14dc343ff60517301c714146ce732"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hellodialog_Tracker.xml" hash="7d32b9c31228e1c1709f05642bed18d2"/></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min/><max/></extension></required></dependencies>
30
  </package>