Version Notes
Added option to send review request via sms or email
Download this release
Release Info
Developer | Abdullah Shah |
Extension | eKomi_integration |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.7 to 1.2.0
- app/code/community/Ekomi/EkomiIntegration/Helper/Data.php +19 -3
- app/code/community/Ekomi/EkomiIntegration/Model/Observer.php +29 -2
- app/code/community/Ekomi/EkomiIntegration/Model/System/Config/Source/Dropdown/Mod.php +41 -0
- app/code/community/Ekomi/EkomiIntegration/etc/system.xml +10 -0
- package.xml +5 -5
app/code/community/Ekomi/EkomiIntegration/Helper/Data.php
CHANGED
@@ -19,7 +19,7 @@ class Ekomi_EkomiIntegration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
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
|
23 |
|
24 |
public function isModuleEnabled($store = null)
|
25 |
{
|
@@ -46,8 +46,24 @@ class Ekomi_EkomiIntegration_Helper_Data extends Mage_Core_Helper_Abstract
|
|
46 |
return Mage::getStoreConfig(self::XML_PATH_ORDER_STATUS, $store);
|
47 |
}
|
48 |
|
49 |
-
public function
|
50 |
{
|
51 |
-
return Mage::getStoreConfig(self::
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
}
|
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_REVIEW_MOD= 'ekomitab/ekomi_ekomiIntegration/review_mod';
|
23 |
|
24 |
public function isModuleEnabled($store = null)
|
25 |
{
|
46 |
return Mage::getStoreConfig(self::XML_PATH_ORDER_STATUS, $store);
|
47 |
}
|
48 |
|
49 |
+
public function getReviewMod($store = null)
|
50 |
{
|
51 |
+
return Mage::getStoreConfig(self::XML_PATH_REVIEW_MOD, $store);
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Validates E164 numbers
|
56 |
+
* @param $phone
|
57 |
+
*
|
58 |
+
* @return bool
|
59 |
+
*/
|
60 |
+
function validateE164($phone)
|
61 |
+
{
|
62 |
+
$pattern = '/^\+?[1-9]\d{1,14}$/';
|
63 |
+
preg_match($pattern, $phone, $matches);
|
64 |
+
if (!empty($matches)) {
|
65 |
+
return true;
|
66 |
+
}
|
67 |
+
return false;
|
68 |
}
|
69 |
}
|
app/code/community/Ekomi/EkomiIntegration/Model/Observer.php
CHANGED
@@ -52,8 +52,8 @@ class Ekomi_EkomiIntegration_Model_Observer
|
|
52 |
{
|
53 |
$helper = Mage::helper('ekomi_ekomiIntegration');
|
54 |
$scheduleTime = date('d-m-Y H:i:s', strtotime($order->getCreatedAtStoreDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)));
|
55 |
-
|
56 |
-
$fields = array('shop_id' => $helper->getShopId($storeId), 'password' => $helper->getShopPassword($storeId), 'salutation' => '',
|
57 |
'first_name' => $order->getBillingAddress()->getFirstname(),
|
58 |
'last_name' => $order->getBillingAddress()->getLastname(),
|
59 |
'email' => $order->getCustomerEmail(), 'transaction_id' => $order->getIncrementId(),
|
@@ -174,4 +174,31 @@ class Ekomi_EkomiIntegration_Model_Observer
|
|
174 |
Mage::logException($e->getMessage());
|
175 |
}
|
176 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
}
|
52 |
{
|
53 |
$helper = Mage::helper('ekomi_ekomiIntegration');
|
54 |
$scheduleTime = date('d-m-Y H:i:s', strtotime($order->getCreatedAtStoreDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)));
|
55 |
+
$apiMode = $this->getRecipientType($order->getBillingAddress()->getTelephone(), $storeId);
|
56 |
+
$fields = array('recipient_type' => $apiMode, 'shop_id' => $helper->getShopId($storeId), 'password' => $helper->getShopPassword($storeId), 'salutation' => '',
|
57 |
'first_name' => $order->getBillingAddress()->getFirstname(),
|
58 |
'last_name' => $order->getBillingAddress()->getLastname(),
|
59 |
'email' => $order->getCustomerEmail(), 'transaction_id' => $order->getIncrementId(),
|
174 |
Mage::logException($e->getMessage());
|
175 |
}
|
176 |
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* @param $telephone
|
180 |
+
* @param $storeId
|
181 |
+
* @return string
|
182 |
+
*/
|
183 |
+
protected function getRecipientType($telephone, $storeId) {
|
184 |
+
$helper = Mage::helper('ekomi_ekomiIntegration');
|
185 |
+
$reviewMod = $helper->getReviewMod($storeId);
|
186 |
+
$apiMode = 'email';
|
187 |
+
switch($reviewMod){
|
188 |
+
case 'sms':
|
189 |
+
$apiMode = 'sms';
|
190 |
+
break;
|
191 |
+
case 'email':
|
192 |
+
$apiMode = 'email';
|
193 |
+
break;
|
194 |
+
case 'fallback':
|
195 |
+
if($helper->validateE164($telephone))
|
196 |
+
$apiMode = 'sms';
|
197 |
+
else
|
198 |
+
$apiMode = 'email';
|
199 |
+
break;
|
200 |
+
}
|
201 |
+
|
202 |
+
return $apiMode;
|
203 |
+
}
|
204 |
}
|
app/code/community/Ekomi/EkomiIntegration/Model/System/Config/Source/Dropdown/Mod.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 to select review mode
|
29 |
+
*
|
30 |
+
*/
|
31 |
+
class Ekomi_EkomiIntegration_Model_System_Config_Source_Dropdown_Mod
|
32 |
+
{
|
33 |
+
|
34 |
+
public function toOptionArray()
|
35 |
+
{
|
36 |
+
return $mod = [['value' => 'email', 'label' => 'email'],
|
37 |
+
['value' => 'sms', 'label' => 'sms'],
|
38 |
+
['value' => 'fallback', 'label' => 'SMS if contact number valid, otherwise Email']];
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
app/code/community/Ekomi/EkomiIntegration/etc/system.xml
CHANGED
@@ -85,6 +85,16 @@
|
|
85 |
<show_in_website>1</show_in_website>
|
86 |
<show_in_store>1</show_in_store>
|
87 |
</order_status>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
</fields>
|
89 |
</ekomi_ekomiIntegration>
|
90 |
</groups>
|
85 |
<show_in_website>1</show_in_website>
|
86 |
<show_in_store>1</show_in_store>
|
87 |
</order_status>
|
88 |
+
<review_mod translate="label">
|
89 |
+
<label>Review Mod</label>
|
90 |
+
<frontend_type>select</frontend_type>
|
91 |
+
<source_model>ekomi_ekomiIntegration/system_config_source_dropdown_mod</source_model>
|
92 |
+
<sort_order>11</sort_order>
|
93 |
+
<comment>How do you want to ask customer for review, email or sms</comment>
|
94 |
+
<show_in_default>1</show_in_default>
|
95 |
+
<show_in_website>1</show_in_website>
|
96 |
+
<show_in_store>1</show_in_store>
|
97 |
+
</review_mod>
|
98 |
</fields>
|
99 |
</ekomi_ekomiIntegration>
|
100 |
</groups>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>eKomi_integration</name>
|
4 |
-
<version>1.
|
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.</p><p><strong>eKomi Reviews and Ratings allows you to:</strong></p><ul><li>Collect order and/or product base Reviews</li><li>Supports Simple, Configurable, Grouped and Bundle products</li><li>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.</li><li>Publish reviews on search engines: Google, Bing, Yahoo!</li><li>Easy Integration with eKomi.</li><li>Get Google Seller Ratings.</li><li>Increase Click through Rate by over 17%</li><li>Increase conversion Rate</li></ul><p>eKomi is available in English, French, German, Spanish, Dutch, Italian, Russian and Polish<br />If you have any questions regarding the plugin, please contact your eKomi Account Manager.</p><p><b>Please note</b> that you will need an eKomi account to use the plugin. To create an eKomi account, go to <a href="http://eKomi.com">eKomi.com</a>.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>Sandor Barics</name><user>sbarics</user><email>sbarics@ekomi.de</email></author></authors>
|
13 |
-
<date>2016-10-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Ekomi"><dir name="EkomiIntegration"><dir name="Helper"><file name="Data.php" hash="
|
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.2.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.</p><p><strong>eKomi Reviews and Ratings allows you to:</strong></p><ul><li>Collect order and/or product base Reviews</li><li>Supports Simple, Configurable, Grouped and Bundle products</li><li>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.</li><li>Publish reviews on search engines: Google, Bing, Yahoo!</li><li>Easy Integration with eKomi.</li><li>Get Google Seller Ratings.</li><li>Increase Click through Rate by over 17%</li><li>Increase conversion Rate</li></ul><p>eKomi is available in English, French, German, Spanish, Dutch, Italian, Russian and Polish<br />If you have any questions regarding the plugin, please contact your eKomi Account Manager.</p><p><b>Please note</b> that you will need an eKomi account to use the plugin. To create an eKomi account, go to <a href="http://eKomi.com">eKomi.com</a>.</description>
|
11 |
+
<notes>Added option to send review request via sms or email</notes>
|
12 |
<authors><author><name>Sandor Barics</name><user>sbarics</user><email>sbarics@ekomi.de</email></author></authors>
|
13 |
+
<date>2016-10-18</date>
|
14 |
+
<time>08:36:18</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Ekomi"><dir name="EkomiIntegration"><dir name="Helper"><file name="Data.php" hash="0ab0b327a3a36b085053fa9095671f3c"/></dir><dir name="Model"><file name="Observer.php" hash="cfcbb45ce19146fcce29ef63417f1fed"/><dir name="System"><dir name="Config"><dir name="Source"><dir name="Dropdown"><file name="Mod.php" hash="474811bd849499523cf2e075f048ece9"/><file name="Status.php" hash="890aab8d85bd23b7a46ab8b87758a018"/></dir></dir></dir></dir><file name="Validate.php" hash="b9de4708ae8fb88f9bb9c9dd0f13abc2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bfb8c20cbf01af974039b5e71a040f71"/><file name="config.xml" hash="f3151a3f31c31cefb97959c71c2c6b02"/><file name="system.xml" hash="d4c5b8d9c2ddf5dfcb73969d2cf01c3a"/></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>
|