kiyoh_customerreview - Version 2.1.0

Version Notes

KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!

Download this release

Release Info

Developer webmeester
Extension kiyoh_customerreview
Version 2.1.0
Comparing to
See all releases


Code changes from version 1.8.0.0 to 2.1.0

Kiyoh-Manual_Dutch+UK.pdf ADDED
Binary file
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/Observer.php CHANGED
@@ -1,46 +1,50 @@
1
  <?php
2
 
3
- class Kiyoh_Customerreview_Adminhtml_Model_Observer
4
  {
5
  public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  //error_log("My observer called ....",0);
8
  $shipment = $observer->getEvent()->getShipment();
9
- $order = $shipment->getOrder();
10
  $email = $order->getCustomerEmail();
11
  $storeId = $order->getStoreId();
12
-
13
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable',$storeId);
14
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event',$storeId);
15
  $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector',$storeId);
16
  $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action',$storeId);
17
  $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user',$storeId);
18
  $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay',$storeId);
19
-
 
 
20
  if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
21
  {
22
-
23
- $url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
24
-
25
  // create a new cURL resource
26
  $curl = curl_init();
27
-
28
  // set URL and other appropriate options
29
  curl_setopt($curl, CURLOPT_URL, $url);
30
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
31
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
32
  curl_setopt($curl, CURLOPT_HEADER, false);
 
 
33
  // grab URL and pass it to the browser
34
  $response = curl_exec($curl);
35
- if (curl_errno($curl))
36
  {
37
  Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
38
  curl_close($curl);
39
  exit;
40
  }
41
-
42
  Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
43
  curl_close($curl);
44
- }
45
  }
46
  }
1
  <?php
2
 
3
+ class Kiyoh_Customerreview_Adminhtml_Model_Observer
4
  {
5
  public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  //error_log("My observer called ....",0);
8
  $shipment = $observer->getEvent()->getShipment();
9
+ $order = $shipment->getOrder();
10
  $email = $order->getCustomerEmail();
11
  $storeId = $order->getStoreId();
12
+
13
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable',$storeId);
14
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event',$storeId);
15
  $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector',$storeId);
16
  $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action',$storeId);
17
  $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user',$storeId);
18
  $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay',$storeId);
19
+ $kiyoh_server = Mage::getStoreConfig('customconfig/review_group/custom_server',$storeId);
20
+
21
+
22
  if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
23
  {
24
+
25
+ $url = 'https://www.'.$kiyoh_server.'/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
26
+
27
  // create a new cURL resource
28
  $curl = curl_init();
29
+
30
  // set URL and other appropriate options
31
  curl_setopt($curl, CURLOPT_URL, $url);
32
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
33
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
34
  curl_setopt($curl, CURLOPT_HEADER, false);
35
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 4);
36
+ curl_setopt($curl, CURLOPT_TIMEOUT, 4);
37
  // grab URL and pass it to the browser
38
  $response = curl_exec($curl);
39
+ if (curl_errno($curl))
40
  {
41
  Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
42
  curl_close($curl);
43
  exit;
44
  }
45
+
46
  Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
47
  curl_close($curl);
48
+ }
49
  }
50
  }
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/System/Config/Source/Orderstatus.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My own options
4
+ *
5
+ */
6
+ class Kiyoh_Customerreview_Adminhtml_Model_System_Config_Source_Orderstatus
7
+ {
8
+
9
+ /**
10
+ * Options getter
11
+ *
12
+ * @return array
13
+ */
14
+ public function toOptionArray()
15
+ {
16
+ $data = Mage::getModel('sales/order_status')->getResourceCollection()->getData();
17
+ foreach($data as $key => $item){
18
+ $data[$key]['value'] = $item['status'];
19
+ }
20
+ return $data;
21
+ }
22
+
23
+ }
24
+ ?>
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/System/Config/Source/Reviewevents.php CHANGED
@@ -17,6 +17,7 @@ class Kiyoh_Customerreview_Adminhtml_Model_System_Config_Source_Reviewevents
17
  array('value' => '', 'label'=>Mage::helper('adminhtml')->__('')),
18
  array('value' => 'Shipping', 'label'=>Mage::helper('adminhtml')->__('Shipping')),
19
  array('value' => 'Purchase', 'label'=>Mage::helper('adminhtml')->__('Purchase')),
 
20
 
21
  );
22
  }
17
  array('value' => '', 'label'=>Mage::helper('adminhtml')->__('')),
18
  array('value' => 'Shipping', 'label'=>Mage::helper('adminhtml')->__('Shipping')),
19
  array('value' => 'Purchase', 'label'=>Mage::helper('adminhtml')->__('Purchase')),
20
+ array('value' => 'Orderstatus', 'label'=>Mage::helper('adminhtml')->__('Order status change')),
21
 
22
  );
23
  }
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/System/Config/Source/Reviewserver.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My own options
4
+ *
5
+ */
6
+ class Kiyoh_Customerreview_Adminhtml_Model_System_Config_Source_Reviewserver
7
+ {
8
+
9
+ /**
10
+ * Options getter
11
+ *
12
+ * @return array
13
+ */
14
+ public function toOptionArray()
15
+ {
16
+ return array(
17
+ array('value' => 'kiyoh.nl', 'label'=>Mage::helper('adminhtml')->__('Kiyoh Netherlands')),
18
+ array('value' => 'kiyoh.com', 'label'=>Mage::helper('adminhtml')->__('Kiyoh International')),
19
+
20
+ );
21
+ }
22
+
23
+ }
24
+ ?>
app/code/community/Kiyoh/Customerreview/Model/Observer.php CHANGED
@@ -1,43 +1,63 @@
1
  <?php
2
 
3
- class Kiyoh_Customerreview_Model_Observer
4
  {
5
- public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  //error_log("My observer called ....",0);
8
  $shipment = $observer->getEvent()->getShipment();
9
- $order = $shipment->getOrder();
10
- $email = $order->getCustomerEmail();
11
- $storeId = $order->getStoreId();
12
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
13
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
14
- $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
15
- $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
16
- $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
17
- $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
18
- if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
19
  {
20
- $url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
21
-
22
- // create a new cURL resource
23
- $curl = curl_init();
24
-
25
- // set URL and other appropriate options
26
- curl_setopt($curl, CURLOPT_URL, $url);
27
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
28
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
29
- curl_setopt($curl, CURLOPT_HEADER, false);
30
- // grab URL and pass it to the browser
31
- $response = curl_exec($curl);
32
- if (curl_errno($curl))
33
- {
34
- Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
35
- curl_close($curl);
36
- exit;
37
- }
38
-
39
- Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
40
- curl_close($curl);
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
  }
1
  <?php
2
 
3
+ class Kiyoh_Customerreview_Model_Observer
4
  {
5
+ public function salesOrderShipmentSaveAfter(Varien_Event_Observer $observer)
6
  {
7
  //error_log("My observer called ....",0);
8
  $shipment = $observer->getEvent()->getShipment();
9
+ $order = $shipment->getOrder();
10
+
 
11
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
12
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
13
+
14
+
15
+ if($kiyoh_eventval === 'Shipping' && $kiyoh_status =='1')
 
 
16
  {
17
+ $this->sendRequest($order);
18
+ }
19
+ }
20
+ public function salesOrderSaveAfter($observer){
21
+ $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
22
+ $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
23
+ $kiyoh_orderstatus = explode(',',Mage::getStoreConfig('customconfig/review_group/custom_event_order_status'));
24
+
25
+ if($kiyoh_eventval === 'Orderstatus' && $kiyoh_status =='1' && in_array($observer->getOrder()->getStatus(), $kiyoh_orderstatus))
26
+ {
27
+ $this->sendRequest($observer->getOrder());
28
+ }
29
+ }
30
+ protected function sendRequest($order){
31
+ $email = $order->getCustomerEmail();
32
+ $storeId = $order->getStoreId();
33
+ $kiyoh_server = Mage::getStoreConfig('customconfig/review_group/custom_server');
34
+ $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
35
+ $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
36
+ $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
37
+
38
+ $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
39
+ $url = 'https://www.'.$kiyoh_server.'/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
40
+
41
+ // create a new cURL resource
42
+ $curl = curl_init();
43
+
44
+ // set URL and other appropriate options
45
+ curl_setopt($curl, CURLOPT_URL, $url);
46
+ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
47
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
48
+ curl_setopt($curl, CURLOPT_HEADER, false);
49
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 4);
50
+ curl_setopt($curl, CURLOPT_TIMEOUT, 4);
51
+ // grab URL and pass it to the browser
52
+ $response = curl_exec($curl);
53
+ if (curl_errno($curl))
54
+ {
55
+ Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
56
+ curl_close($curl);
57
+ exit;
58
+ }
59
+
60
+ Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
61
+ curl_close($curl);
62
  }
63
  }
app/code/community/Kiyoh/Customerreview/etc/config.xml CHANGED
@@ -1,5 +1,5 @@
1
  <?xml version="1.0"?>
2
- <!--
3
  /**
4
  * @category Kiyoh
5
  * @package Kiyoh_Customerreview
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Kiyoh_Customerreview>
13
- <version>0.1.0</version>
14
  </Kiyoh_Customerreview>
15
  </modules>
16
  <frontend>
@@ -18,7 +18,7 @@
18
  <customerreview>
19
  <use>standard</use>
20
  <args>
21
- <module>Kiyoh_Customerreview</module>
22
  <frontName>customerreview</frontName>
23
  </args>
24
  </customerreview>
@@ -40,6 +40,15 @@
40
  </customerreview>
41
  </observers>
42
  </sales_order_shipment_save_after>
 
 
 
 
 
 
 
 
 
43
  </events>
44
  </frontend>
45
 
@@ -61,8 +70,17 @@
61
  </customerreview>
62
  </observers>
63
  </sales_order_shipment_save_after>
64
- </events>
65
- </adminhtml>
 
 
 
 
 
 
 
 
 
66
  <global>
67
  <models>
68
  <customerreview_adminhtml>
@@ -88,6 +106,7 @@
88
  <customconfig>
89
  <review_group>
90
  <custom_action>sendInvitation</custom_action>
 
91
  </review_group>
92
  </customconfig>
93
  </default>
1
  <?xml version="1.0"?>
2
+ <!--
3
  /**
4
  * @category Kiyoh
5
  * @package Kiyoh_Customerreview
10
  <config>
11
  <modules>
12
  <Kiyoh_Customerreview>
13
+ <version>2.0.0.1</version>
14
  </Kiyoh_Customerreview>
15
  </modules>
16
  <frontend>
18
  <customerreview>
19
  <use>standard</use>
20
  <args>
21
+ <module>Kiyoh_Customerreview</module>
22
  <frontName>customerreview</frontName>
23
  </args>
24
  </customerreview>
40
  </customerreview>
41
  </observers>
42
  </sales_order_shipment_save_after>
43
+ <sales_order_save_after>
44
+ <observers>
45
+ <customerreview_orderstatus_change>
46
+ <type>singleton</type>
47
+ <class>Kiyoh_Customerreview_Model_Observer</class>
48
+ <method>salesOrderSaveAfter</method>
49
+ </customerreview_orderstatus_change>
50
+ </observers>
51
+ </sales_order_save_after>
52
  </events>
53
  </frontend>
54
 
70
  </customerreview>
71
  </observers>
72
  </sales_order_shipment_save_after>
73
+ <sales_order_save_after>
74
+ <observers>
75
+ <customerreview_orderstatus_change>
76
+ <type>singleton</type>
77
+ <class>Kiyoh_Customerreview_Model_Observer</class>
78
+ <method>salesOrderSaveAfter</method>
79
+ </customerreview_orderstatus_change>
80
+ </observers>
81
+ </sales_order_save_after>
82
+ </events>
83
+ </adminhtml>
84
  <global>
85
  <models>
86
  <customerreview_adminhtml>
106
  <customconfig>
107
  <review_group>
108
  <custom_action>sendInvitation</custom_action>
109
+ <custom_server>kiyoh.nl</custom_server>
110
  </review_group>
111
  </customconfig>
112
  </default>
app/code/community/Kiyoh/Customerreview/etc/system.xml CHANGED
@@ -12,7 +12,7 @@
12
  <sort_order>200</sort_order>
13
  <show_in_default>1</show_in_default>
14
  <show_in_website>1</show_in_website>
15
- <show_in_store>1</show_in_store>
16
  <tab>mynew_tab</tab>
17
  <groups>
18
  <review_group translate="label">
@@ -34,7 +34,7 @@
34
  <source_model>adminhtml/system_config_source_yesno</source_model>
35
  <comment>Recommended Value is Yes. On setting it to NO, module ll stop sending email invites to customers.</comment>
36
  </custom_enable>
37
-
38
  <custom_connector translate="label tooltip comment">
39
  <label>Enter Connector</label>
40
  <frontend_type>text</frontend_type>
@@ -45,13 +45,13 @@
45
  <comment>Enter here the Kiyoh Connector Code from your Kiyoh Account.</comment>
46
  </custom_connector>
47
  <custom_action translate="label tooltip comment">
48
-
49
  <frontend_type>hidden</frontend_type>
50
  <sort_order>2</sort_order>
51
  <show_in_default>0</show_in_default>
52
  <show_in_website>0</show_in_website>
53
  <show_in_store>0</show_in_store>
54
-
55
  </custom_action>
56
  <custom_user translate="label tooltip comment">
57
  <label>Enter User</label>
@@ -81,6 +81,26 @@
81
  <show_in_store>1</show_in_store>
82
  <comment>Enter here the event after which you would like to send review invite email to your customer. Enter Shipping if your store sells products that need shipping. Enter Purchase if your store sells downloadable products(softwares).</comment>
83
  </custom_event>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  </fields>
85
  </review_group>
86
  </groups>
12
  <sort_order>200</sort_order>
13
  <show_in_default>1</show_in_default>
14
  <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
  <tab>mynew_tab</tab>
17
  <groups>
18
  <review_group translate="label">
34
  <source_model>adminhtml/system_config_source_yesno</source_model>
35
  <comment>Recommended Value is Yes. On setting it to NO, module ll stop sending email invites to customers.</comment>
36
  </custom_enable>
37
+
38
  <custom_connector translate="label tooltip comment">
39
  <label>Enter Connector</label>
40
  <frontend_type>text</frontend_type>
45
  <comment>Enter here the Kiyoh Connector Code from your Kiyoh Account.</comment>
46
  </custom_connector>
47
  <custom_action translate="label tooltip comment">
48
+
49
  <frontend_type>hidden</frontend_type>
50
  <sort_order>2</sort_order>
51
  <show_in_default>0</show_in_default>
52
  <show_in_website>0</show_in_website>
53
  <show_in_store>0</show_in_store>
54
+
55
  </custom_action>
56
  <custom_user translate="label tooltip comment">
57
  <label>Enter User</label>
81
  <show_in_store>1</show_in_store>
82
  <comment>Enter here the event after which you would like to send review invite email to your customer. Enter Shipping if your store sells products that need shipping. Enter Purchase if your store sells downloadable products(softwares).</comment>
83
  </custom_event>
84
+ <custom_event_order_status translate="label">
85
+ <label>Order Status</label>
86
+ <frontend_type>multiselect</frontend_type>
87
+ <source_model>customerreview_adminhtml/system_config_source_orderstatus</source_model>
88
+ <sort_order>6</sort_order>
89
+ <show_in_default>1</show_in_default>
90
+ <show_in_website>1</show_in_website>
91
+ <show_in_store>1</show_in_store>
92
+ <depends><custom_event>Orderstatus</custom_event></depends>
93
+ </custom_event_order_status>
94
+ <custom_server translate="label tooltip comment">
95
+ <label>Select Server</label>
96
+ <frontend_type>select</frontend_type>
97
+ <source_model>customerreview_adminhtml/system_config_source_reviewserver</source_model>
98
+ <sort_order>7</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ <comment></comment>
103
+ </custom_server>
104
  </fields>
105
  </review_group>
106
  </groups>
app/design/frontend/default/default/template/kiyohcheckout/success.phtml CHANGED
@@ -20,8 +20,7 @@
20
  * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category design
23
- * @package base_default
24
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
25
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
  */
27
  /***************connect***************/
@@ -45,101 +44,35 @@ $email = '';
45
  if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
46
  $this->_data['email'] = $this->__($this->htmlEscape(Mage::getSingleton('customer/session')->getCustomer()->getEmail()));
47
  $email = $this->_data['email'];
48
- }
49
-
50
 
51
  /**
52
  *Support to multidomain code
53
  *Start to multidomain
54
- */
55
  $kiyoh_multicount = 'false';
56
  /*$_SERVER['MAGE_RUN_CODE'] = 'domain1_com';
57
  $_SERVER['MAGE_RUN_TYPE'] = 'website';
58
  */
59
 
60
- if(!isset($_SERVER['MAGE_RUN_CODE']) && !isset($_SERVER['MAGE_RUN_TYPE']))
61
- {
62
- $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
63
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
64
  }
65
  else
66
  {
67
- if($_SERVER['MAGE_RUN_TYPE'] == 'website')
68
- {
69
 
70
- $kiyoh_results = $kiyoh_read->fetchAll("SELECT website_id FROM ".$kiyoh_tablePrefix."core_website where code = '".$_SERVER['MAGE_RUN_CODE']."'");
71
- $kiyoh_websiteId = $kiyoh_results[0]['website_id'];
72
- $scope = 'websites';
73
- $kiyoh_multicount = 'true';
74
- }
75
- if($_SERVER['MAGE_RUN_TYPE'] == 'store')
76
- {
77
- $kiyoh_results = $kiyoh_read->fetchAll("SELECT store_id FROM ".$kiyoh_tablePrefix."core_store where code = '".$_SERVER['MAGE_RUN_CODE']."'");
78
- $kiyoh_websiteId = $kiyoh_results[0]['store_id'];
79
- $scope = 'stores';
80
- $kiyoh_multicount = 'true';
81
- }
82
  }
83
 
84
- /**
85
- *Block To Find kiyoh setting for present store
86
- */
87
 
88
- if($kiyoh_multicount == 'true')
89
- {
90
- $kiyoh_findTocoreconfig = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope=".$scope." AND scope_id = ".$kiyoh_websiteId);
91
- foreach($kiyoh_findTocoreconfig as $value)
92
- {
93
- if($value['path'] == 'customconfig/review_group/custom_enable')
94
- {
95
- $kiyoh_status = $value['value'];
96
- }
97
- if($value['path'] == 'customconfig/review_group/custom_connector')
98
- {
99
- $kiyoh_connector = $value['value'];
100
- }
101
- if($value['path'] == 'customconfig/review_group/custom_action')
102
- {
103
- $kiyoh_action = $value['value'];
104
- }
105
- if($value['path'] == 'customconfig/review_group/custom_user')
106
- {
107
- $kiyoh_user = $value['value'];
108
- }
109
- if($value['path'] == 'customconfig/review_group/custom_delay')
110
- {
111
- $kiyoh_delay = $value['value'];
112
- }
113
- if($value['path'] == 'customconfig/review_group/custom_event')
114
- {
115
- $kiyoh_eventval = $value['value'];
116
- }
117
- }
118
- }
119
- if(!isset($kiyoh_connector))
120
- {
121
  $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
122
- }
123
- if(!isset($kiyoh_action))
124
- {
125
  $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
126
- }
127
- if(!isset($kiyoh_user))
128
- {
129
  $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
130
- }
131
- if(!isset($kiyoh_delay))
132
- {
133
  $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
134
- }
135
- if(!isset($kiyoh_eventval))
136
- {
137
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
138
- }
139
- if(!isset($kiyoh_status))
140
- {
141
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
142
- }
143
 
144
  /**
145
  *Block To Find kiyoh setting for present store
@@ -148,10 +81,10 @@ if($kiyoh_eventval == 'Purchase' && $kiyoh_status == '1')
148
  {
149
 
150
  ////call url
151
-
152
  // create a new cURL resource
153
-
154
-
155
  // Create a curl handle
156
 
157
  /**
@@ -159,22 +92,22 @@ if($kiyoh_eventval == 'Purchase' && $kiyoh_status == '1')
159
  */
160
  if($email == '')
161
  {
162
- $_customerId = Mage::getSingleton('customer/session')->getCustomerId();
163
- $customer = Mage::getSingleton('customer/session')->getCustomer();
164
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
165
  $order = Mage::getSingleton('sales/order');
166
  $order->load($lastOrderId);
167
  $_totalData = $order->getData();
168
- $_details = $customer->getData();
169
- $orderId = $_totalData['increment_id'];
170
  $email = $_totalData['customer_email']; //Retrieves guest e-mail
171
- // $name = $order->getBillingAddress()->getName(); //Retrieves guest name
172
  }
173
 
 
174
 
175
-
176
- $url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
177
-
178
  // create a new cURL resource
179
  $curl = curl_init();
180
 
@@ -184,16 +117,19 @@ $url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_con
184
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
185
  curl_setopt($curl, CURLOPT_HEADER, false);
186
 
187
-
 
 
 
188
  // grab URL and pass it to the browser
189
 
190
  $response = curl_exec($curl);
191
 
192
- if (curl_errno($curl))
193
  {
194
  print curl_error($curl);exit;
195
- }
196
- else
197
  {
198
  curl_close($curl);
199
  }
@@ -209,4 +145,4 @@ curl_close($curl);
209
 
210
 
211
  ?>
212
-
20
  * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category design
23
+ * @package default_default
 
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  /***************connect***************/
44
  if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn()) {
45
  $this->_data['email'] = $this->__($this->htmlEscape(Mage::getSingleton('customer/session')->getCustomer()->getEmail()));
46
  $email = $this->_data['email'];
47
+ }
48
+
49
 
50
  /**
51
  *Support to multidomain code
52
  *Start to multidomain
53
+ */
54
  $kiyoh_multicount = 'false';
55
  /*$_SERVER['MAGE_RUN_CODE'] = 'domain1_com';
56
  $_SERVER['MAGE_RUN_TYPE'] = 'website';
57
  */
58
 
59
+ if(!isset($_SERVER['MAGE_RUN_CODE']) && !isset($_SERVER['MAGE_RUN_TYPE']))
60
+ {
61
+ $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
62
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
63
  }
64
  else
65
  {
 
 
66
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
 
 
 
 
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  $kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
 
 
 
71
  $kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
 
 
 
72
  $kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
 
 
 
73
  $kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
 
 
 
74
  $kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
 
 
 
75
  $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
 
76
 
77
  /**
78
  *Block To Find kiyoh setting for present store
81
  {
82
 
83
  ////call url
84
+
85
  // create a new cURL resource
86
+
87
+
88
  // Create a curl handle
89
 
90
  /**
92
  */
93
  if($email == '')
94
  {
95
+ //$_customerId = Mage::getSingleton('customer/session')->getCustomerId();
96
+ //$customer = Mage::getSingleton('customer/session')->getCustomer();
97
  $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
98
  $order = Mage::getSingleton('sales/order');
99
  $order->load($lastOrderId);
100
  $_totalData = $order->getData();
101
+ //$_details = $customer->getData();
102
+ //$orderId = $_totalData['increment_id'];
103
  $email = $_totalData['customer_email']; //Retrieves guest e-mail
104
+ // $name = $order->getBillingAddress()->getName(); //Retrieves guest name
105
  }
106
 
107
+ $kiyoh_server = Mage::getStoreConfig('customconfig/review_group/custom_server');
108
 
109
+ $url = 'https://www.'.$kiyoh_server.'/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
110
+ echo '<div style="display:none">'.$url.'</div>';
 
111
  // create a new cURL resource
112
  $curl = curl_init();
113
 
117
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
118
  curl_setopt($curl, CURLOPT_HEADER, false);
119
 
120
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 4);
121
+ curl_setopt($curl, CURLOPT_TIMEOUT, 4);
122
+
123
+
124
  // grab URL and pass it to the browser
125
 
126
  $response = curl_exec($curl);
127
 
128
+ if (curl_errno($curl))
129
  {
130
  print curl_error($curl);exit;
131
+ }
132
+ else
133
  {
134
  curl_close($curl);
135
  }
145
 
146
 
147
  ?>
148
+
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>kiyoh_customerreview</name>
4
- <version>1.8.0.0</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen,</summary>
10
  <description>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</description>
11
  <notes>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</notes>
12
  <authors><author><name>webmeester</name><user>kiyoh_m</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
13
- <date>2012-08-18</date>
14
- <time>06:39:05</time>
15
- <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Kiyoh"><dir name="Customerreview"><dir name="Adminhtml"><dir name="Model"><file name="Observer.php" hash="af7726cee75e3db9d9947ff58058db9d"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Reviewevents.php" hash="696a6147fa76fe8c8eaf32e525f995b9"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Customerreview.php" hash="be8fa564fc669477445c9d8d1c7fba5c"/></dir><dir name="Helper"><file name="Data.php" hash="fda5c34b4da4ade55e107f88fc7c6287"/></dir><dir name="Model"><file name="Customerreview.php" hash="fb2f4a070079adce2670b871c1a4cd6a"/><file name="Observer.php" hash="fef9e7191351cfa9f45907a87b47d8b7"/><file name="Status.php" hash="8f23938b83ae9fa9cd404c99aa5716e7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6cf979d01f8317d9dd7a177747ab24f2"/><file name="config.xml" hash="be7afc04ea8d1fed109c1e8c8a57a67c"/><file name="system.xml" hash="f181db3d8c95e5ccd83d4bfbd5cb8548"/></dir></dir></dir></dir></dir><dir name="design"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customerreview.xml" hash="6243b98b49e4a1da50b0dae968b4d171"/></dir><dir name="template"><dir name="customerreview"><file name="customerreview.phtml" hash="c692037d1baf7c41be15ff9a2b0e126e"/></dir><dir name="kiyohcheckout"><file name="success.phtml" hash="58af22c984e4b38bcf43f84c1053f1eb"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Kiyoh_Customerreview.xml" hash="bbaf093738bc2b0835c48341a8849acb"/></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>kiyoh_customerreview</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
+ <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen,</summary>
10
  <description>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</description>
11
  <notes>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</notes>
12
  <authors><author><name>webmeester</name><user>kiyoh_m</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
13
+ <date>2013-11-18</date>
14
+ <time>09:14:32</time>
15
+ <contents><target name="magecommunity"><dir name="Kiyoh"><dir name="Customerreview"><dir name="Adminhtml"><dir name="Model"><file name="Observer.php" hash="f8194bf3ad9dee655442efe6d6157759"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Orderstatus.php" hash="68dc416b21d91823e506b05cc09c3f6c"/><file name="Reviewevents.php" hash="bec91300ce7358f7e40fa2652b9ab545"/><file name="Reviewserver.php" hash="de91656e5e87b96706ef10b212f6c513"/></dir></dir></dir></dir></dir><dir name="Block"><file name="Customerreview.php" hash="be8fa564fc669477445c9d8d1c7fba5c"/></dir><dir name="Helper"><file name="Data.php" hash="fda5c34b4da4ade55e107f88fc7c6287"/></dir><dir name="Model"><file name="Customerreview.php" hash="fb2f4a070079adce2670b871c1a4cd6a"/><file name="Observer.php" hash="d18c0640e27103380b34fbff4082e184"/><file name="Status.php" hash="8f23938b83ae9fa9cd404c99aa5716e7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6cf979d01f8317d9dd7a177747ab24f2"/><file name="config.xml" hash="a97163485a03e1c9ff28c0bc63874598"/><file name="system.xml" hash="b33d83308b83b7afc1c7aafcede5df2d"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customerreview.xml" hash="6243b98b49e4a1da50b0dae968b4d171"/></dir><dir name="template"><dir name="customerreview"><file name="customerreview.phtml" hash="c692037d1baf7c41be15ff9a2b0e126e"/></dir><dir name="kiyohcheckout"><file name="success.phtml" hash="cd5db468fb6a8348d38bef2956b78c2a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kiyoh_Customerreview.xml" hash="bbaf093738bc2b0835c48341a8849acb"/></dir></target><target name="mage"><dir name="."><file name="Kiyoh-Manual_Dutch+UK.pdf" hash="3c19995cafeb48b41af6d536dc9e66e1"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>