eKomi_integration - Version 1.0.0

Version Notes

Please note that you will need an eKomi account to use the plugin. To create an eKomi account, go to eKomi.com.

Download this release

Release Info

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


Version 1.0.0

app/code/community/Ekomi/EkomiIntegration/Helper/Data.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ekomi
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@magentocommerce.com so we can send you a copy immediately.
14
+ */
15
+ class Ekomi_EkomiIntegration_Helper_Data extends Mage_Core_Helper_Abstract
16
+ {
17
+ const XML_PATH_ACTIVE = 'ekomitab/ekomi_ekomiIntegration/active';
18
+ const XML_PATH_SERVER_ADDRESS = 'ekomitab/ekomi_ekomiIntegration/server_address';
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)
24
+ {
25
+ return Mage::getStoreConfig(self::XML_PATH_ACTIVE, $store);
26
+ }
27
+
28
+ public function getServerAddress($store = null)
29
+ {
30
+ return Mage::getStoreConfig(self::XML_PATH_SERVER_ADDRESS, $store);
31
+ }
32
+
33
+ public function getShopId($store = null)
34
+ {
35
+ return Mage::getStoreConfig(self::XML_PATH_SHOP_ID, $store);
36
+ }
37
+
38
+ public function getShopPassword($store = null)
39
+ {
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);
46
+ }
47
+ }
app/code/community/Ekomi/EkomiIntegration/Model/Observer.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Inchoo
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@magentocommerce.com so we can send you a copy immediately.
14
+ */
15
+ class Ekomi_EkomiIntegration_Model_Observer extends Mage_Core_Helper_Abstract
16
+ {
17
+ public function sendOrderToEkomi($observer)
18
+ {
19
+
20
+ $order = $observer->getEvent()->getOrder();
21
+ $storeId = $order->getStoreId();
22
+ $customer_id = $order->getCustomerId();
23
+ $customerData = Mage::getModel('customer/customer')->load($customer_id);
24
+ $helper = Mage::helper('ekomi_ekomiIntegration');
25
+ $boundary = md5( time() );
26
+ if (!$helper->isModuleEnabled($storeId)) {
27
+ return;
28
+ }
29
+
30
+ try {
31
+ $schedule_time = date('d-m-Y H:i:s',strtotime($order->getCreatedAtStoreDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)));
32
+ $fields = array( 'shop_id'=>$helper->getShopId($storeId), 'password'=>$helper->getShopPassword($storeId), 'salutation'=>'', 'first_name'=>$order->getBillingAddress()->getFirstname(), 'last_name'=>$order->getBillingAddress()->getLastname(), 'email'=>$order->getCustomerEmail(), 'transaction_id'=>$order->getId(),'product_id'=>'','product_name'=>'', 'transaction_time'=>$schedule_time, 'telephone'=>$order->getBillingAddress()->getTelephone());
33
+ $postvars = '';
34
+ $counter=1;
35
+ foreach($fields as $key=>$value) {
36
+ if($counter > 1)$postvars .="&";
37
+ $postvars .= $key . "=" . $value;
38
+ $counter++;
39
+ }
40
+ $ch = curl_init();
41
+ curl_setopt($ch, CURLOPT_URL,$helper->getServerAddress($storeId));
42
+ curl_setopt($ch, CURLOPT_HEADER, false);
43
+ curl_setopt($ch, CURLOPT_HTTPHEADER, 'ContentType:multipart/form-data;boundary=' . $boundary);
44
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
45
+ curl_setopt($ch, CURLOPT_POST , 1);
46
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
47
+ $server_output = curl_exec ($ch);
48
+ //Mage::logException($server_output);
49
+ curl_close ($ch);
50
+ } catch (Exception $e) {
51
+ Mage::logException($e);
52
+ }
53
+ }
54
+ }
app/code/community/Ekomi/EkomiIntegration/Model/Validate.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ekomi
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@magentocommerce.com so we can send you a copy immediately.
14
+ */
15
+ class Ekomi_EkomiIntegration_Model_Validate extends Mage_Core_Model_Config_Data
16
+ {
17
+ public function save()
18
+ {
19
+ $PostData=Mage::app()->getRequest()->getPost();
20
+ foreach($PostData['groups']['ekomi_ekomiIntegration'] as $fields)
21
+ {
22
+ if($fields['server_address'])
23
+ $ServerAddress=$fields['server_address']['value'];
24
+ if($fields['shop_id'])
25
+ $ShopId=$fields['shop_id']['value'];
26
+ if($fields['shop_password'])
27
+ $ShopPassword=$fields['shop_password']['value'];
28
+ }
29
+ if ($ShopId =='' || $ShopPassword=='') {
30
+ Mage::throwException('Shop ID & Password Required.');
31
+ }
32
+ else {
33
+ $ch = curl_init();
34
+ curl_setopt($ch, CURLOPT_URL,"http://api.ekomi.de/v3/getSettings?auth=".$ShopId."|".$ShopPassword."&version=cust-1.0.0&type=request&charset=iso");
35
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
36
+ $server_output = curl_exec ($ch);
37
+ curl_close ($ch);
38
+ if($server_output=='Access denied')
39
+ Mage::throwException($server_output);
40
+ else
41
+ return parent::save();
42
+ }
43
+ }
44
+ }
app/code/community/Ekomi/EkomiIntegration/etc/adminhtml.xml ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0"?><config> <acl> <resources> <admin> <children> <system> <children> <config> <children> <ekomitab> <title>Ekomi Integration Settings</title> <!-- Used in resources tree --> </ekomitab> </children> </config> </children> </system> </children> </admin> </resources> </acl></config>
app/code/community/Ekomi/EkomiIntegration/etc/config.xml ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ekomi
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ -->
16
+ <config>
17
+ <modules>
18
+ <Ekomi_EkomiIntegration>
19
+ <version>1.0.0.0</version>
20
+ </Ekomi_EkomiIntegration>
21
+ </modules>
22
+ <global>
23
+ <models>
24
+ <ekomi_ekomiIntegration>
25
+ <class>Ekomi_EkomiIntegration_Model</class>
26
+ </ekomi_ekomiIntegration>
27
+ </models>
28
+ <helpers>
29
+ <ekomi_ekomiIntegration>
30
+ <class>Ekomi_EkomiIntegration_Helper</class>
31
+ </ekomi_ekomiIntegration>
32
+ </helpers>
33
+ <blocks>
34
+ <ekomi_ekomiIntegration>
35
+ <class>Ekomi_EkomiIntegration_Block</class>
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>
50
+ <ekomitab>
51
+ <ekomi_ekomiIntegration>
52
+ <server_address>http://srr.ekomi.com/add-recipient</server_address>
53
+ </ekomi_ekomiIntegration>
54
+ </ekomitab>
55
+ </default>
56
+ </config>
app/code/community/Ekomi/EkomiIntegration/etc/system.xml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ekomi
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+
16
+ -->
17
+ <config>
18
+ <tabs>
19
+ <ekomiconf translate="label">
20
+ <label>Ekomi Integration</label>
21
+ <sort_order>150</sort_order>
22
+ </ekomiconf>
23
+ </tabs>
24
+ <sections>
25
+ <ekomitab translate="label" module="adminhtml">
26
+ <label>Ekomi Integration</label>
27
+ <tab>ekomiconf</tab>
28
+ <sort_order>10</sort_order>
29
+ <show_in_default>1</show_in_default>
30
+ <show_in_website>1</show_in_website>
31
+ <show_in_store>1</show_in_store>
32
+ <groups>
33
+ <ekomi_ekomiIntegration translate="label" module="ekomi_ekomiIntegration">
34
+ <label>Ekomi Integration</label>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>900</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <fields>
41
+ <active translate="label">
42
+ <label>Enabled</label>
43
+ <backend_model>ekomi_ekomiIntegration/validate</backend_model>
44
+ <frontend_type>select</frontend_type>
45
+ <source_model>adminhtml/system_config_source_yesno</source_model>
46
+ <sort_order>1</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ </active>
51
+ <server_address translate="label">
52
+ <label>Server Address</label>
53
+ <frontend_type>text</frontend_type>
54
+ <sort_order>2</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ </server_address>
59
+ <shop_id translate="label">
60
+ <label>Shop ID</label>
61
+ <frontend_type>text</frontend_type>
62
+ <sort_order>3</sort_order>
63
+ <show_in_default>1</show_in_default>
64
+ <show_in_website>1</show_in_website>
65
+ <show_in_store>1</show_in_store>
66
+ </shop_id>
67
+ <shop_password translate="label">
68
+ <label>Shop Password</label>
69
+ <frontend_type>text</frontend_type>
70
+ <sort_order>4</sort_order>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>1</show_in_website>
73
+ <show_in_store>1</show_in_store>
74
+ </shop_password>
75
+ <debug_result translate="label">
76
+ <label>Debug</label>
77
+ <frontend_type>select</frontend_type>
78
+ <source_model>adminhtml/system_config_source_yesno</source_model>
79
+ <sort_order>5</sort_order>
80
+ <show_in_default>1</show_in_default>
81
+ <show_in_website>1</show_in_website>
82
+ <show_in_store>1</show_in_store>
83
+ </debug_result>
84
+ </fields>
85
+ </ekomi_ekomiIntegration>
86
+ </groups>
87
+ </ekomitab>
88
+ </sections>
89
+ </config>
app/etc/modules/Ekomi_EkomiIntegration.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ekomi
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ */
17
+ -->
18
+ <config>
19
+ <modules>
20
+ <Ekomi_EkomiIntegration>
21
+ <active>true</active>
22
+ <codePool>community</codePool>
23
+ <depends>
24
+ <Mage_Sales />
25
+ <Mage_Adminhtml />
26
+ </depends>
27
+ </Ekomi_EkomiIntegration>
28
+ </modules>
29
+ </config>
package.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>eKomi_integration</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="https://opensource.org/licenses/osl-3.0.php">AFL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Magento Plugin 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.</summary>
10
+ <description>- Easy Integration with eKomi &#xD;
11
+ - Get Google Seller Ratings &#xD;
12
+ - Increase Click Through Rate by over 17%&#xD;
13
+ - Increase Conversion Rate&#xD;
14
+ &#xD;
15
+ eKomi Magento Plugin 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. &#xD;
16
+ &#xD;
17
+ eKomi Reviews and Ratings allows you to:&#xD;
18
+ a. Collect Reviews&#xD;
19
+ b. 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. &#xD;
20
+ c. Publish reviews on search engines: Google, Bing, Yahoo! &#xD;
21
+ &#xD;
22
+ eKomi is available in English, French, German, Spanish, Dutch, Italian, Russian and Polish (more languages coming soon). &#xD;
23
+ &#xD;
24
+ If you have any questions regarding the plugin, please contact your eKomi Account Manager. &#xD;
25
+ &#xD;
26
+ Please note that you will need an eKomi account to use the plugin. To create an eKomi account, go to eKomi.com. &#xD;
27
+ &#xD;
28
+ </description>
29
+ <notes>Please note that you will need an eKomi account to use the plugin. To create an eKomi account, go to eKomi.com. </notes>
30
+ <authors><author><name>Heinz Schrader</name><user>hschrader</user><email>hschrader@ekomi-group.com</email></author></authors>
31
+ <date>2016-02-12</date>
32
+ <time>11:25:25</time>
33
+ <contents><target name="magecommunity"><dir name="Ekomi"><dir name="EkomiIntegration"><dir name="Helper"><file name="Data.php" hash="a8b86cd94342c7581ec5e998d8b20b52"/></dir><dir name="Model"><file name="Observer.php" hash="c30cf21f39175bfc006c427c8dd4af9c"/><file name="Validate.php" hash="4fef3a8c58b1d932ef15a2c4fd8249d2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2d3f2d8b63b0af22a11d5dee861fddfc"/><file name="config.xml" hash="c9df3f8b155985722d29a0959e106c8b"/><file name="system.xml" hash="2bd693d000ca2e9dd490e7611eefb1fd"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ekomi_EkomiIntegration.xml" hash="7b3e0502ed1f43af3463faa952697e88"/></dir></target></contents>
34
+ <compatible/>
35
+ <dependencies><required><php><min>5.0.0</min><max>5.3.0</max></php></required></dependencies>
36
+ </package>