eKomi_integration - Version 1.1.0

Version Notes

- Instead of sending review emails for all orders, admin can select order status for which review emails will be sent.
- Product canonical url and image url will also be sent to put products at eKomi

Download this release

Release Info

Developer Heinz Schrader
Extension eKomi_integration
Version 1.1.0
Comparing to
See all releases


Code changes from version 1.0.3 to 1.1.0

app/code/community/Ekomi/EkomiIntegration/Helper/Data.php CHANGED
@@ -18,6 +18,7 @@ class Ekomi_EkomiIntegration_Helper_Data extends Mage_Core_Helper_Abstract
18
  const XML_PATH_PRODUCT_REVIEWS = 'ekomitab/ekomi_ekomiIntegration/product_reviews';
19
  const XML_PATH_SHOP_ID = 'ekomitab/ekomi_ekomiIntegration/shop_id';
20
  const XML_PATH_SHOP_PASSWORD = 'ekomitab/ekomi_ekomiIntegration/shop_password';
 
21
  const XML_PATH_DEBUG_RESULT= 'ekomitab/ekomi_ekomiIntegration/debug_result';
22
 
23
  public function isModuleEnabled($store = null)
@@ -40,6 +41,11 @@ class Ekomi_EkomiIntegration_Helper_Data extends Mage_Core_Helper_Abstract
40
  return Mage::getStoreConfig(self::XML_PATH_SHOP_PASSWORD, $store);
41
  }
42
 
 
 
 
 
 
43
  public function getDebugResult($store = null)
44
  {
45
  return Mage::getStoreConfig(self::XML_PATH_DEBUG_RESULT, $store);
18
  const XML_PATH_PRODUCT_REVIEWS = 'ekomitab/ekomi_ekomiIntegration/product_reviews';
19
  const XML_PATH_SHOP_ID = 'ekomitab/ekomi_ekomiIntegration/shop_id';
20
  const XML_PATH_SHOP_PASSWORD = 'ekomitab/ekomi_ekomiIntegration/shop_password';
21
+ const XML_PATH_ORDER_STATUS = 'ekomitab/ekomi_ekomiIntegration/order_status';
22
  const XML_PATH_DEBUG_RESULT= 'ekomitab/ekomi_ekomiIntegration/debug_result';
23
 
24
  public function isModuleEnabled($store = null)
41
  return Mage::getStoreConfig(self::XML_PATH_SHOP_PASSWORD, $store);
42
  }
43
 
44
+ public function getOrderStatusForReviewEmail($store = null)
45
+ {
46
+ return Mage::getStoreConfig(self::XML_PATH_ORDER_STATUS, $store);
47
+ }
48
+
49
  public function getDebugResult($store = null)
50
  {
51
  return Mage::getStoreConfig(self::XML_PATH_DEBUG_RESULT, $store);
app/code/community/Ekomi/EkomiIntegration/Model/Observer.php CHANGED
@@ -25,13 +25,13 @@ class Ekomi_EkomiIntegration_Model_Observer
25
  $storeId = $order->getStoreId();
26
  $helper = Mage::helper('ekomi_ekomiIntegration');
27
 
28
- if (!$helper->isModuleEnabled($storeId)) {
29
  return;
30
  }
31
 
32
  try {
33
  $postvars = $this->getData($order, $storeId);
34
-
35
  if ($postvars != '') {
36
  $this->sendOrderData($postvars);
37
  }
@@ -61,7 +61,9 @@ class Ekomi_EkomiIntegration_Model_Observer
61
  );
62
  if ($helper->isProductReviewEnabled($storeId)){
63
  $fields['has_products'] = 1;
64
- $fields['products_info'] = $this->getOrderProductsData($order);
 
 
65
  }
66
  $postvars = '';
67
  $counter = 1;
@@ -75,14 +77,29 @@ class Ekomi_EkomiIntegration_Model_Observer
75
  return $postvars;
76
  }
77
 
78
- protected function getOrderProductsData($order)
79
  {
80
  $items = $order->getAllVisibleItems();
81
  foreach ($items as $item) {
82
- $products[$item->getId()] = urlencode($item->getName());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
- return json_encode($products);
86
  }
87
 
88
  /**
25
  $storeId = $order->getStoreId();
26
  $helper = Mage::helper('ekomi_ekomiIntegration');
27
 
28
+ if (!$helper->isModuleEnabled($storeId) || ($helper->getOrderStatusForReviewEmail() != $order->getStatus())) {
29
  return;
30
  }
31
 
32
  try {
33
  $postvars = $this->getData($order, $storeId);
34
+
35
  if ($postvars != '') {
36
  $this->sendOrderData($postvars);
37
  }
61
  );
62
  if ($helper->isProductReviewEnabled($storeId)){
63
  $fields['has_products'] = 1;
64
+ $productsData = $this->getOrderProductsData($order, $storeId);
65
+ $fields['products_info'] = json_encode($productsData['product_info']);
66
+ $fields['products_other'] = json_encode($productsData['other']);
67
  }
68
  $postvars = '';
69
  $counter = 1;
77
  return $postvars;
78
  }
79
 
80
+ protected function getOrderProductsData($order, $storeId)
81
  {
82
  $items = $order->getAllVisibleItems();
83
  foreach ($items as $item) {
84
+ $product = $item ->getProduct();
85
+ $products['product_info'][$item->getId()] = urlencode($item->getName());
86
+ $product->setStoreId($storeId);
87
+ $canonicalUrl = $product->getUrlModel()->getUrl($product, array('_ignore_category'=>true));
88
+ $canonicalUrl = strstr($canonicalUrl, "?", true);
89
+ $productOther = array(
90
+ 'image_url' => utf8_decode(Mage::helper('catalog/image')->init($product, 'thumbnail')),
91
+ 'product_ids' => array(
92
+ 'ean' => utf8_decode($product->getSku())
93
+ ), // product IDs
94
+ 'links' => array(
95
+ array('rel' => 'canonical', 'type' => 'text/html',
96
+ 'href' => utf8_decode($canonicalUrl))
97
+ )
98
+ );
99
+ $products['other'][$item->getId()]['product_other'] = $productOther;
100
  }
101
 
102
+ return $products;
103
  }
104
 
105
  /**
app/code/community/Ekomi/EkomiIntegration/Model/System/Config/Source/Dropdown/Status.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Adminhtml
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Used in creating options for order status config value selection
29
+ *
30
+ */
31
+ class Ekomi_EkomiIntegration_Model_System_Config_Source_Dropdown_Status
32
+ {
33
+
34
+ public function toOptionArray()
35
+ {
36
+ $orderStatusCollection = Mage::getModel('sales/order_status')->getResourceCollection()->getData();
37
+
38
+ foreach ($orderStatusCollection as $orderStatus) {
39
+ $status[] = array(
40
+ 'value' => $orderStatus['status'], 'label' => $orderStatus['label']
41
+ );
42
+ }
43
+
44
+ return $status;
45
+ }
46
+
47
+ }
app/code/community/Ekomi/EkomiIntegration/etc/config.xml CHANGED
@@ -36,14 +36,14 @@
36
  </ekomi_ekomiIntegration>
37
  </blocks>
38
  <events>
39
- <sales_order_place_after>
40
  <observers>
41
  <ekomi_ekomiIntegration_sendOrderToEkomi>
42
  <class>ekomi_ekomiIntegration/observer</class>
43
  <method>sendOrderToEkomi</method>
44
  </ekomi_ekomiIntegration_sendOrderToEkomi>
45
  </observers>
46
- </sales_order_place_after>
47
  </events>
48
  </global>
49
  <default>
36
  </ekomi_ekomiIntegration>
37
  </blocks>
38
  <events>
39
+ <sales_order_save_after>
40
  <observers>
41
  <ekomi_ekomiIntegration_sendOrderToEkomi>
42
  <class>ekomi_ekomiIntegration/observer</class>
43
  <method>sendOrderToEkomi</method>
44
  </ekomi_ekomiIntegration_sendOrderToEkomi>
45
  </observers>
46
+ </sales_order_save_after>
47
  </events>
48
  </global>
49
  <default>
app/code/community/Ekomi/EkomiIntegration/etc/system.xml CHANGED
@@ -75,11 +75,21 @@
75
  <show_in_website>1</show_in_website>
76
  <show_in_store>1</show_in_store>
77
  </shop_password>
 
 
 
 
 
 
 
 
 
 
78
  <debug_result translate="label">
79
  <label>Debug</label>
80
  <frontend_type>select</frontend_type>
81
  <source_model>adminhtml/system_config_source_yesno</source_model>
82
- <sort_order>9</sort_order>
83
  <show_in_default>1</show_in_default>
84
  <show_in_website>1</show_in_website>
85
  <show_in_store>1</show_in_store>
@@ -89,4 +99,4 @@
89
  </groups>
90
  </ekomitab>
91
  </sections>
92
- </config>
75
  <show_in_website>1</show_in_website>
76
  <show_in_store>1</show_in_store>
77
  </shop_password>
78
+ <order_status translate="label">
79
+ <label>Order Status</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>ekomi_ekomiIntegration/system_config_source_dropdown_status</source_model>
82
+ <sort_order>9</sort_order>
83
+ <comment>Order status when review email should be sent. Please note number of days added for delay will be after this</comment>
84
+ <show_in_default>1</show_in_default>
85
+ <show_in_website>1</show_in_website>
86
+ <show_in_store>1</show_in_store>
87
+ </order_status>
88
  <debug_result translate="label">
89
  <label>Debug</label>
90
  <frontend_type>select</frontend_type>
91
  <source_model>adminhtml/system_config_source_yesno</source_model>
92
+ <sort_order>11</sort_order>
93
  <show_in_default>1</show_in_default>
94
  <show_in_website>1</show_in_website>
95
  <show_in_store>1</show_in_store>
99
  </groups>
100
  </ekomitab>
101
  </sections>
102
+ </config>
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>eKomi_integration</name>
4
- <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license>AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This plugin allows you to integrate your magento shop easily with eKomi system to collect verified reviews</summary>
10
- <description>&lt;p&gt;eKomi Plugin for Magento allows you to integrate your Magento shop easily with eKomi system. This allows you to collect verified reviews, display eKomi seal on your website and get your seller ratings on Google. This helps you increase your website's click through rates, conversion rates and also, if you are running Google AdWord Campaigns, this helps in improving your Quality Score and hence your costs per click.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;eKomi Reviews and Ratings allows you to:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Collect order and/or product base Reviews&lt;/li&gt;&lt;li&gt;Supports Simple, Configurable, Grouped and Bundle products&lt;/li&gt;&lt;li&gt;Manage Reviews: our team of Customer Feedback Managers, reviews each and every review for any terms which are not allowed and also put all negative reviews in moderation.&lt;/li&gt;&lt;li&gt;Publish reviews on search engines: Google, Bing, Yahoo!&lt;/li&gt;&lt;li&gt;Easy Integration with eKomi.&lt;/li&gt;&lt;li&gt;Get Google Seller Ratings.&lt;/li&gt;&lt;li&gt;Increase Click through Rate by over 17%&lt;/li&gt;&lt;li&gt;Increase conversion Rate&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;eKomi is available in English, French, German, Spanish, Dutch, Italian, Russian and Polish&lt;br /&gt;If you have any questions regarding the plugin, please contact your eKomi Account Manager.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Please note&lt;/b&gt; that you will need an eKomi account to use the plugin. To create an eKomi account, go to &lt;a href="http://eKomi.com"&gt;eKomi.com&lt;/a&gt;.&lt;/p&gt;</description>
11
- <notes>Product names having special char and space was not registering correctly</notes>
 
12
  <authors><author><name>Heinz Schrader</name><user>hschrader</user><email>hschrader@ekomi-group.com</email></author></authors>
13
- <date>2016-04-05</date>
14
- <time>12:07:30</time>
15
- <contents><target name="magecommunity"><dir name="Ekomi"><dir name="EkomiIntegration"><dir name="Helper"><file name="Data.php" hash="08041314f50b10d1842ba92296acdf56"/></dir><dir name="Model"><file name="Observer.php" hash="b655950119593250abc75dd1e8cdab01"/><file name="Validate.php" hash="3ef621788942bff9f80b36683696d936"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2d3f2d8b63b0af22a11d5dee861fddfc"/><file name="config.xml" hash="f3e8d2a39f33eb32c79d1e6b5b98726c"/><file name="system.xml" hash="3f350c3747fb7289f71392966482c54d"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ekomi_EkomiIntegration.xml" hash="e84d0589f7081183d0d3d1e1c66c059e"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.0.0</min><max>7.0.1</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>eKomi_integration</name>
4
+ <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>This plugin allows you to integrate your magento shop easily with eKomi system to collect verified reviews</summary>
10
+ <description>eKomi Plugin for Magento allows you to integrate your Magento shop easily with eKomi system. This allows you to collect verified reviews, display eKomi seal on your website and get your seller ratings on Google. This helps you increase your website's click through rates, conversion rates and also, if you are running Google AdWord Campaigns, this helps in improving your Quality Score and hence your costs per click.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;eKomi Reviews and Ratings allows you to:&lt;/strong&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Collect order and/or product base Reviews&lt;/li&gt;&lt;li&gt;Supports Simple, Configurable, Grouped and Bundle products&lt;/li&gt;&lt;li&gt;Manage Reviews: our team of Customer Feedback Managers, reviews each and every review for any terms which are not allowed and also put all negative reviews in moderation.&lt;/li&gt;&lt;li&gt;Publish reviews on search engines: Google, Bing, Yahoo!&lt;/li&gt;&lt;li&gt;Easy Integration with eKomi.&lt;/li&gt;&lt;li&gt;Get Google Seller Ratings.&lt;/li&gt;&lt;li&gt;Increase Click through Rate by over 17%&lt;/li&gt;&lt;li&gt;Increase conversion Rate&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;eKomi is available in English, French, German, Spanish, Dutch, Italian, Russian and Polish&lt;br /&gt;If you have any questions regarding the plugin, please contact your eKomi Account Manager.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Please note&lt;/b&gt; that you will need an eKomi account to use the plugin. To create an eKomi account, go to &lt;a href="http://eKomi.com"&gt;eKomi.com&lt;/a&gt;.</description>
11
+ <notes>- Instead of sending review emails for all orders, admin can select order status for which review emails will be sent. &#xD;
12
+ - Product canonical url and image url will also be sent to put products at eKomi</notes>
13
  <authors><author><name>Heinz Schrader</name><user>hschrader</user><email>hschrader@ekomi-group.com</email></author></authors>
14
+ <date>2016-04-20</date>
15
+ <time>07:55:23</time>
16
+ <contents><target name="magecommunity"><dir name="Ekomi"><dir name="EkomiIntegration"><dir name="Helper"><file name="Data.php" hash="8be49ce99c68f7f2b07cf1f14d78bc71"/></dir><dir name="Model"><file name="Observer.php" hash="ede218ead9109d1e3e46dac4ed4df1ba"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Status.php" hash="890aab8d85bd23b7a46ab8b87758a018"/></dir></dir></dir></dir><file name="Validate.php" hash="3ef621788942bff9f80b36683696d936"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2d3f2d8b63b0af22a11d5dee861fddfc"/><file name="config.xml" hash="975ee81758ce2f8864852a0c28964959"/><file name="system.xml" hash="fe30d8242380fe5501ccda068c737e0e"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ekomi_EkomiIntegration.xml" hash="e84d0589f7081183d0d3d1e1c66c059e"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.0.0</min><max>7.0.1</max></php></required></dependencies>
19
  </package>