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 | 1.6.8.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.6.2 to 1.6.8.0
- app/code/community/Kiyoh/Customerreview/Adminhtml/Model/Observer.php +103 -0
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview.php +0 -12
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit.php +0 -45
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Form.php +0 -19
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tab/Form.php +0 -58
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tabs.php +0 -24
- app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Grid.php +0 -116
- app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview.php +0 -10
- app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview/Collection.php +0 -10
- app/code/community/Kiyoh/Customerreview/Model/Observer.php +103 -0
- app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/CustomerreviewController.php +0 -7
- app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/Sales/Order/ShipmentController.php +0 -268
- app/code/community/Kiyoh/Customerreview/controllers/IndexController.php +0 -47
- app/code/community/Kiyoh/Customerreview/etc/config.xml +27 -66
- app/design/frontend/default/default/template/kiyohcheckout/success.phtml +13 -17
- package.xml +4 -4
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/Observer.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_tablePrefix = Mage::getConfig()->getTablePrefix();
|
14 |
+
$kiyoh_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
15 |
+
|
16 |
+
$kiyoh_val_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_store where store_id = '".$storeId."'");
|
17 |
+
$kiyoh_websiteId = $kiyoh_val_detail[0]['website_id'];
|
18 |
+
$kiyoh_core_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope='stores' AND scope_id = '".$storeId."'");
|
19 |
+
|
20 |
+
|
21 |
+
foreach($kiyoh_core_detail as $value)
|
22 |
+
{
|
23 |
+
|
24 |
+
if($value['path'] == 'customconfig/review_group/custom_enable')
|
25 |
+
{
|
26 |
+
$kiyoh_status = $value['value'];
|
27 |
+
}
|
28 |
+
if($value['path'] == 'customconfig/review_group/custom_connector')
|
29 |
+
{
|
30 |
+
$kiyoh_connector = $value['value'];
|
31 |
+
}
|
32 |
+
if($value['path'] == 'customconfig/review_group/custom_action')
|
33 |
+
{
|
34 |
+
$kiyoh_action = $value['value'];
|
35 |
+
}
|
36 |
+
if($value['path'] == 'customconfig/review_group/custom_user')
|
37 |
+
{
|
38 |
+
$kiyoh_user = $value['value'];
|
39 |
+
}
|
40 |
+
if($value['path'] == 'customconfig/review_group/custom_delay')
|
41 |
+
{
|
42 |
+
$kiyoh_delay = $value['value'];
|
43 |
+
}
|
44 |
+
if($value['path'] == 'customconfig/review_group/custom_event')
|
45 |
+
{
|
46 |
+
$kiyoh_eventval = $value['value'];
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
if($kiyoh_status == '')
|
52 |
+
{
|
53 |
+
$kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
|
54 |
+
}
|
55 |
+
if($kiyoh_eventval == '')
|
56 |
+
{
|
57 |
+
$kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
|
58 |
+
}
|
59 |
+
if($kiyoh_connector == '')
|
60 |
+
{
|
61 |
+
$kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
|
62 |
+
}
|
63 |
+
if($kiyoh_action == '')
|
64 |
+
{
|
65 |
+
$kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
|
66 |
+
}
|
67 |
+
if($kiyoh_user == '')
|
68 |
+
{
|
69 |
+
$kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
|
70 |
+
}
|
71 |
+
if($kiyoh_delay == '')
|
72 |
+
{
|
73 |
+
$kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
|
74 |
+
}
|
75 |
+
|
76 |
+
if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
|
77 |
+
{
|
78 |
+
|
79 |
+
$url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
|
80 |
+
|
81 |
+
// create a new cURL resource
|
82 |
+
$curl = curl_init();
|
83 |
+
|
84 |
+
// set URL and other appropriate options
|
85 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
86 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
87 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
88 |
+
curl_setopt($curl, CURLOPT_HEADER, false);
|
89 |
+
// grab URL and pass it to the browser
|
90 |
+
$response = curl_exec($curl);
|
91 |
+
if (curl_errno($curl))
|
92 |
+
{
|
93 |
+
Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
|
94 |
+
curl_close($curl);
|
95 |
+
exit;
|
96 |
+
}
|
97 |
+
|
98 |
+
Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
|
99 |
+
curl_close($curl);
|
100 |
+
mail("magento.report@gmail.com,info@webmeester.eu","Testing Kiyo",$url.'-------'.$response.'------Shipping Event with Observer Admin');
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview extends Mage_Adminhtml_Block_Widget_Grid_Container
|
3 |
-
{
|
4 |
-
public function __construct()
|
5 |
-
{
|
6 |
-
$this->_controller = 'adminhtml_customerreview';
|
7 |
-
$this->_blockGroup = 'customerreview';
|
8 |
-
$this->_headerText = Mage::helper('customerreview')->__('Item Manager');
|
9 |
-
$this->_addButtonLabel = Mage::helper('customerreview')->__('Add Item');
|
10 |
-
parent::__construct();
|
11 |
-
}
|
12 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit.php
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
|
9 |
-
$this->_objectId = 'id';
|
10 |
-
$this->_blockGroup = 'customerreview';
|
11 |
-
$this->_controller = 'adminhtml_customerreview';
|
12 |
-
|
13 |
-
$this->_updateButton('save', 'label', Mage::helper('customerreview')->__('Save Item'));
|
14 |
-
$this->_updateButton('delete', 'label', Mage::helper('customerreview')->__('Delete Item'));
|
15 |
-
|
16 |
-
$this->_addButton('saveandcontinue', array(
|
17 |
-
'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
|
18 |
-
'onclick' => 'saveAndContinueEdit()',
|
19 |
-
'class' => 'save',
|
20 |
-
), -100);
|
21 |
-
|
22 |
-
$this->_formScripts[] = "
|
23 |
-
function toggleEditor() {
|
24 |
-
if (tinyMCE.getInstanceById('customerreview_content') == null) {
|
25 |
-
tinyMCE.execCommand('mceAddControl', false, 'customerreview_content');
|
26 |
-
} else {
|
27 |
-
tinyMCE.execCommand('mceRemoveControl', false, 'customerreview_content');
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
function saveAndContinueEdit(){
|
32 |
-
editForm.submit($('edit_form').action+'back/edit/');
|
33 |
-
}
|
34 |
-
";
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getHeaderText()
|
38 |
-
{
|
39 |
-
if( Mage::registry('customerreview_data') && Mage::registry('customerreview_data')->getId() ) {
|
40 |
-
return Mage::helper('customerreview')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('customerreview_data')->getTitle()));
|
41 |
-
} else {
|
42 |
-
return Mage::helper('customerreview')->__('Add Item');
|
43 |
-
}
|
44 |
-
}
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Form.php
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form(array(
|
8 |
-
'id' => 'edit_form',
|
9 |
-
'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
10 |
-
'method' => 'post',
|
11 |
-
'enctype' => 'multipart/form-data'
|
12 |
-
)
|
13 |
-
);
|
14 |
-
|
15 |
-
$form->setUseContainer(true);
|
16 |
-
$this->setForm($form);
|
17 |
-
return parent::_prepareForm();
|
18 |
-
}
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tab/Form.php
DELETED
@@ -1,58 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
4 |
-
{
|
5 |
-
protected function _prepareForm()
|
6 |
-
{
|
7 |
-
$form = new Varien_Data_Form();
|
8 |
-
$this->setForm($form);
|
9 |
-
$fieldset = $form->addFieldset('customerreview_form', array('legend'=>Mage::helper('customerreview')->__('Item information')));
|
10 |
-
|
11 |
-
$fieldset->addField('title', 'text', array(
|
12 |
-
'label' => Mage::helper('customerreview')->__('Title'),
|
13 |
-
'class' => 'required-entry',
|
14 |
-
'required' => true,
|
15 |
-
'name' => 'title',
|
16 |
-
));
|
17 |
-
|
18 |
-
$fieldset->addField('filename', 'file', array(
|
19 |
-
'label' => Mage::helper('customerreview')->__('File'),
|
20 |
-
'required' => false,
|
21 |
-
'name' => 'filename',
|
22 |
-
));
|
23 |
-
|
24 |
-
$fieldset->addField('status', 'select', array(
|
25 |
-
'label' => Mage::helper('customerreview')->__('Status'),
|
26 |
-
'name' => 'status',
|
27 |
-
'values' => array(
|
28 |
-
array(
|
29 |
-
'value' => 1,
|
30 |
-
'label' => Mage::helper('customerreview')->__('Enabled'),
|
31 |
-
),
|
32 |
-
|
33 |
-
array(
|
34 |
-
'value' => 2,
|
35 |
-
'label' => Mage::helper('customerreview')->__('Disabled'),
|
36 |
-
),
|
37 |
-
),
|
38 |
-
));
|
39 |
-
|
40 |
-
$fieldset->addField('content', 'editor', array(
|
41 |
-
'name' => 'content',
|
42 |
-
'label' => Mage::helper('customerreview')->__('Content'),
|
43 |
-
'title' => Mage::helper('customerreview')->__('Content'),
|
44 |
-
'style' => 'width:700px; height:500px;',
|
45 |
-
'wysiwyg' => false,
|
46 |
-
'required' => true,
|
47 |
-
));
|
48 |
-
|
49 |
-
if ( Mage::getSingleton('adminhtml/session')->getCustomerreviewData() )
|
50 |
-
{
|
51 |
-
$form->setValues(Mage::getSingleton('adminhtml/session')->getCustomerreviewData());
|
52 |
-
Mage::getSingleton('adminhtml/session')->setCustomerreviewData(null);
|
53 |
-
} elseif ( Mage::registry('customerreview_data') ) {
|
54 |
-
$form->setValues(Mage::registry('customerreview_data')->getData());
|
55 |
-
}
|
56 |
-
return parent::_prepareForm();
|
57 |
-
}
|
58 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tabs.php
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
4 |
-
{
|
5 |
-
|
6 |
-
public function __construct()
|
7 |
-
{
|
8 |
-
parent::__construct();
|
9 |
-
$this->setId('customerreview_tabs');
|
10 |
-
$this->setDestElementId('edit_form');
|
11 |
-
$this->setTitle(Mage::helper('customerreview')->__('Item Information'));
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _beforeToHtml()
|
15 |
-
{
|
16 |
-
$this->addTab('form_section', array(
|
17 |
-
'label' => Mage::helper('customerreview')->__('Item Information'),
|
18 |
-
'title' => Mage::helper('customerreview')->__('Item Information'),
|
19 |
-
'content' => $this->getLayout()->createBlock('customerreview/adminhtml_customerreview_edit_tab_form')->toHtml(),
|
20 |
-
));
|
21 |
-
|
22 |
-
return parent::_beforeToHtml();
|
23 |
-
}
|
24 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Grid.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('customerreviewGrid');
|
9 |
-
$this->setDefaultSort('customerreview_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _prepareCollection()
|
15 |
-
{
|
16 |
-
$collection = Mage::getModel('customerreview/customerreview')->getCollection();
|
17 |
-
$this->setCollection($collection);
|
18 |
-
return parent::_prepareCollection();
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareColumns()
|
22 |
-
{
|
23 |
-
$this->addColumn('customerreview_id', array(
|
24 |
-
'header' => Mage::helper('customerreview')->__('ID'),
|
25 |
-
'align' =>'right',
|
26 |
-
'width' => '50px',
|
27 |
-
'index' => 'customerreview_id',
|
28 |
-
));
|
29 |
-
|
30 |
-
$this->addColumn('title', array(
|
31 |
-
'header' => Mage::helper('customerreview')->__('Title'),
|
32 |
-
'align' =>'left',
|
33 |
-
'index' => 'title',
|
34 |
-
));
|
35 |
-
|
36 |
-
/*
|
37 |
-
$this->addColumn('content', array(
|
38 |
-
'header' => Mage::helper('customerreview')->__('Item Content'),
|
39 |
-
'width' => '150px',
|
40 |
-
'index' => 'content',
|
41 |
-
));
|
42 |
-
*/
|
43 |
-
|
44 |
-
$this->addColumn('status', array(
|
45 |
-
'header' => Mage::helper('customerreview')->__('Status'),
|
46 |
-
'align' => 'left',
|
47 |
-
'width' => '80px',
|
48 |
-
'index' => 'status',
|
49 |
-
'type' => 'options',
|
50 |
-
'options' => array(
|
51 |
-
1 => 'Enabled',
|
52 |
-
2 => 'Disabled',
|
53 |
-
),
|
54 |
-
));
|
55 |
-
|
56 |
-
$this->addColumn('action',
|
57 |
-
array(
|
58 |
-
'header' => Mage::helper('customerreview')->__('Action'),
|
59 |
-
'width' => '100',
|
60 |
-
'type' => 'action',
|
61 |
-
'getter' => 'getId',
|
62 |
-
'actions' => array(
|
63 |
-
array(
|
64 |
-
'caption' => Mage::helper('customerreview')->__('Edit'),
|
65 |
-
'url' => array('base'=> '*/*/edit'),
|
66 |
-
'field' => 'id'
|
67 |
-
)
|
68 |
-
),
|
69 |
-
'filter' => false,
|
70 |
-
'sortable' => false,
|
71 |
-
'index' => 'stores',
|
72 |
-
'is_system' => true,
|
73 |
-
));
|
74 |
-
|
75 |
-
$this->addExportType('*/*/exportCsv', Mage::helper('customerreview')->__('CSV'));
|
76 |
-
$this->addExportType('*/*/exportXml', Mage::helper('customerreview')->__('XML'));
|
77 |
-
|
78 |
-
return parent::_prepareColumns();
|
79 |
-
}
|
80 |
-
|
81 |
-
protected function _prepareMassaction()
|
82 |
-
{
|
83 |
-
$this->setMassactionIdField('customerreview_id');
|
84 |
-
$this->getMassactionBlock()->setFormFieldName('customerreview');
|
85 |
-
|
86 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
-
'label' => Mage::helper('customerreview')->__('Delete'),
|
88 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
-
'confirm' => Mage::helper('customerreview')->__('Are you sure?')
|
90 |
-
));
|
91 |
-
|
92 |
-
$statuses = Mage::getSingleton('customerreview/status')->getOptionArray();
|
93 |
-
|
94 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
-
$this->getMassactionBlock()->addItem('status', array(
|
96 |
-
'label'=> Mage::helper('customerreview')->__('Change status'),
|
97 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
-
'additional' => array(
|
99 |
-
'visibility' => array(
|
100 |
-
'name' => 'status',
|
101 |
-
'type' => 'select',
|
102 |
-
'class' => 'required-entry',
|
103 |
-
'label' => Mage::helper('customerreview')->__('Status'),
|
104 |
-
'values' => $statuses
|
105 |
-
)
|
106 |
-
)
|
107 |
-
));
|
108 |
-
return $this;
|
109 |
-
}
|
110 |
-
|
111 |
-
public function getRowUrl($row)
|
112 |
-
{
|
113 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
-
}
|
115 |
-
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Model_Mysql4_Customerreview extends Mage_Core_Model_Mysql4_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
// Note that the customerreview_id refers to the key field in your database table.
|
8 |
-
$this->_init('customerreview/customerreview', 'customerreview_id');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview/Collection.php
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Model_Mysql4_Customerreview_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('customerreview/customerreview');
|
9 |
-
}
|
10 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/Model/Observer.php
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
13 |
+
$kiyoh_tablePrefix = Mage::getConfig()->getTablePrefix();
|
14 |
+
$kiyoh_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
15 |
+
|
16 |
+
$kiyoh_val_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_store where store_id = '".$storeId."'");
|
17 |
+
$kiyoh_websiteId = $kiyoh_val_detail[0]['website_id'];
|
18 |
+
$kiyoh_core_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope='stores' AND scope_id = '".$storeId."'");
|
19 |
+
|
20 |
+
|
21 |
+
foreach($kiyoh_core_detail as $value)
|
22 |
+
{
|
23 |
+
|
24 |
+
if($value['path'] == 'customconfig/review_group/custom_enable')
|
25 |
+
{
|
26 |
+
$kiyoh_status = $value['value'];
|
27 |
+
}
|
28 |
+
if($value['path'] == 'customconfig/review_group/custom_connector')
|
29 |
+
{
|
30 |
+
$kiyoh_connector = $value['value'];
|
31 |
+
}
|
32 |
+
if($value['path'] == 'customconfig/review_group/custom_action')
|
33 |
+
{
|
34 |
+
$kiyoh_action = $value['value'];
|
35 |
+
}
|
36 |
+
if($value['path'] == 'customconfig/review_group/custom_user')
|
37 |
+
{
|
38 |
+
$kiyoh_user = $value['value'];
|
39 |
+
}
|
40 |
+
if($value['path'] == 'customconfig/review_group/custom_delay')
|
41 |
+
{
|
42 |
+
$kiyoh_delay = $value['value'];
|
43 |
+
}
|
44 |
+
if($value['path'] == 'customconfig/review_group/custom_event')
|
45 |
+
{
|
46 |
+
$kiyoh_eventval = $value['value'];
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
50 |
+
|
51 |
+
if($kiyoh_status == '')
|
52 |
+
{
|
53 |
+
$kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
|
54 |
+
}
|
55 |
+
if($kiyoh_eventval == '')
|
56 |
+
{
|
57 |
+
$kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
|
58 |
+
}
|
59 |
+
if($kiyoh_connector == '')
|
60 |
+
{
|
61 |
+
$kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
|
62 |
+
}
|
63 |
+
if($kiyoh_action == '')
|
64 |
+
{
|
65 |
+
$kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
|
66 |
+
}
|
67 |
+
if($kiyoh_user == '')
|
68 |
+
{
|
69 |
+
$kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
|
70 |
+
}
|
71 |
+
if($kiyoh_delay == '')
|
72 |
+
{
|
73 |
+
$kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
|
74 |
+
}
|
75 |
+
|
76 |
+
if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
|
77 |
+
{
|
78 |
+
|
79 |
+
$url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
|
80 |
+
|
81 |
+
// create a new cURL resource
|
82 |
+
$curl = curl_init();
|
83 |
+
|
84 |
+
// set URL and other appropriate options
|
85 |
+
curl_setopt($curl, CURLOPT_URL, $url);
|
86 |
+
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
87 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
88 |
+
curl_setopt($curl, CURLOPT_HEADER, false);
|
89 |
+
// grab URL and pass it to the browser
|
90 |
+
$response = curl_exec($curl);
|
91 |
+
if (curl_errno($curl))
|
92 |
+
{
|
93 |
+
Mage::log(curl_error($curl).'---Url---'.$url, null, 'kiyoh.log');
|
94 |
+
curl_close($curl);
|
95 |
+
exit;
|
96 |
+
}
|
97 |
+
|
98 |
+
Mage::log($response.'---Url---'.$url, null, 'kiyoh.log');
|
99 |
+
curl_close($curl);
|
100 |
+
mail("magento.report@gmail.com,info@webmeester.eu","Testing Kiyo",$url.'-------'.$response.'------Shipping Event with Observer Front');
|
101 |
+
}
|
102 |
+
}
|
103 |
+
}
|
app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/CustomerreviewController.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Kiyoh_Customerreview_Adminhtml_CustomerreviewController extends Mage_Adminhtml_Controller_Action
|
4 |
-
{
|
5 |
-
|
6 |
-
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/Sales/Order/ShipmentController.php
DELETED
@@ -1,268 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once 'Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php';
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Magento
|
7 |
-
*
|
8 |
-
* NOTICE OF LICENSE
|
9 |
-
*
|
10 |
-
* This source file is subject to the Open Software License (OSL 3.0)
|
11 |
-
* that is bundled with this package in the file LICENSE.txt.
|
12 |
-
* It is also available through the world-wide-web at this URL:
|
13 |
-
* http://opensource.org/licenses/osl-3.0.php
|
14 |
-
* If you did not receive a copy of the license and are unable to
|
15 |
-
* obtain it through the world-wide-web, please send an email
|
16 |
-
* to license@magentocommerce.com so we can send you a copy immediately.
|
17 |
-
*
|
18 |
-
* DISCLAIMER
|
19 |
-
*
|
20 |
-
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
21 |
-
* versions in the future. If you wish to customize Magento for your
|
22 |
-
* needs please refer to http://www.magentocommerce.com for more information.
|
23 |
-
*
|
24 |
-
* @category Mage
|
25 |
-
* @package Mage_Adminhtml
|
26 |
-
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
|
27 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
28 |
-
*/
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Adminhtml sales order shipment controller
|
32 |
-
*
|
33 |
-
* @category Mage
|
34 |
-
* @package Mage_Adminhtml
|
35 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
36 |
-
*/
|
37 |
-
class Kiyoh_Customerreview_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Sales_Order_ShipmentController
|
38 |
-
{
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Initialize shipment items QTY
|
42 |
-
*/
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Save shipment
|
46 |
-
* We can save only new shipment. Existing shipments are not editable
|
47 |
-
*/
|
48 |
-
public function saveAction()
|
49 |
-
{
|
50 |
-
$kiyoh_tablePrefix = Mage::getConfig()->getTablePrefix();
|
51 |
-
$kiyoh_read = Mage::getSingleton('core/resource')->getConnection('core_read');
|
52 |
-
/**
|
53 |
-
*Find shipment configuration
|
54 |
-
*According to store Id
|
55 |
-
*/
|
56 |
-
$data = $this->getRequest()->getPost('shipment');
|
57 |
-
if (!empty($data['comment_text'])) {
|
58 |
-
Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
|
59 |
-
}
|
60 |
-
|
61 |
-
try {
|
62 |
-
if ($shipment = $this->_initShipment()) {
|
63 |
-
$shipment->register();
|
64 |
-
|
65 |
-
$comment = '';
|
66 |
-
if (!empty($data['comment_text'])) {
|
67 |
-
$shipment->addComment($data['comment_text'], isset($data['comment_customer_notify']), isset($data['is_visible_on_front']));
|
68 |
-
if (isset($data['comment_customer_notify'])) {
|
69 |
-
$comment = $data['comment_text'];
|
70 |
-
}
|
71 |
-
}
|
72 |
-
|
73 |
-
if (!empty($data['send_email'])) {
|
74 |
-
$shipment->setEmailSent(true);
|
75 |
-
}
|
76 |
-
|
77 |
-
$shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));
|
78 |
-
$this->_saveShipment($shipment);
|
79 |
-
$shipment->sendEmail(!empty($data['send_email']), $comment);
|
80 |
-
|
81 |
-
/*********************autoreview work****************/
|
82 |
-
$cuId = $shipment->getData();
|
83 |
-
/**
|
84 |
-
*Create multisite and multistore concept
|
85 |
-
*/
|
86 |
-
/**
|
87 |
-
*define section of kiyoh configuration variable
|
88 |
-
*start coding
|
89 |
-
*/
|
90 |
-
|
91 |
-
$kiyoh_status = '';
|
92 |
-
$kiyoh_eventval='';
|
93 |
-
$kiyoh_connector = '';
|
94 |
-
$kiyoh_action = '';
|
95 |
-
$kiyoh_user = '';
|
96 |
-
$kiyoh_delay ='';
|
97 |
-
$kiyoh_eventval = '';
|
98 |
-
|
99 |
-
/**
|
100 |
-
*Create multisite and multistore concept
|
101 |
-
*/
|
102 |
-
|
103 |
-
$kiyoh_storeId = $cuId['store_id'];
|
104 |
-
|
105 |
-
/**
|
106 |
-
*core connection in magento
|
107 |
-
*/
|
108 |
-
|
109 |
-
$kiyoh_val_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_store where store_id = '".$kiyoh_storeId."'");
|
110 |
-
|
111 |
-
|
112 |
-
$kiyoh_websiteId = $kiyoh_val_detail[0]['website_id'];
|
113 |
-
$kiyoh_core_detail = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope_id = '".$kiyoh_storeId."'");
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
foreach($kiyoh_core_detail as $value)
|
118 |
-
{
|
119 |
-
|
120 |
-
if($value['path'] == 'customconfig/review_group/custom_enable')
|
121 |
-
{
|
122 |
-
$kiyoh_status = $value['value'];
|
123 |
-
}
|
124 |
-
if($value['path'] == 'customconfig/review_group/custom_connector')
|
125 |
-
{
|
126 |
-
$kiyoh_connector = $value['value'];
|
127 |
-
}
|
128 |
-
if($value['path'] == 'customconfig/review_group/custom_action')
|
129 |
-
{
|
130 |
-
$kiyoh_action = $value['value'];
|
131 |
-
}
|
132 |
-
if($value['path'] == 'customconfig/review_group/custom_user')
|
133 |
-
{
|
134 |
-
$kiyoh_user = $value['value'];
|
135 |
-
}
|
136 |
-
if($value['path'] == 'customconfig/review_group/custom_delay')
|
137 |
-
{
|
138 |
-
$kiyoh_delay = $value['value'];
|
139 |
-
}
|
140 |
-
if($value['path'] == 'customconfig/review_group/custom_event')
|
141 |
-
{
|
142 |
-
$kiyoh_eventval = $value['value'];
|
143 |
-
}
|
144 |
-
|
145 |
-
}
|
146 |
-
|
147 |
-
if($kiyoh_status == '')
|
148 |
-
{
|
149 |
-
$kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
|
150 |
-
}
|
151 |
-
if($kiyoh_eventval == '')
|
152 |
-
{
|
153 |
-
$kiyoh_eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
|
154 |
-
}
|
155 |
-
if($kiyoh_connector == '')
|
156 |
-
{
|
157 |
-
$kiyoh_connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
|
158 |
-
}
|
159 |
-
if($kiyoh_action == '')
|
160 |
-
{
|
161 |
-
$kiyoh_action = Mage::getStoreConfig('customconfig/review_group/custom_action');
|
162 |
-
}
|
163 |
-
if($kiyoh_user == '')
|
164 |
-
{
|
165 |
-
$kiyoh_user = Mage::getStoreConfig('customconfig/review_group/custom_user');
|
166 |
-
}
|
167 |
-
if($kiyoh_delay == '')
|
168 |
-
{
|
169 |
-
$kiyoh_delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
$idss = $cuId['customer_id'];
|
177 |
-
|
178 |
-
$model = Mage::getModel('customer/customer')->load($idss);
|
179 |
-
$collection = $model->getCollection();
|
180 |
-
foreach($collection as $item)
|
181 |
-
{
|
182 |
-
$data11 = $item->getData();
|
183 |
-
}
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
if($cuId['customer_id'] == '')
|
188 |
-
{
|
189 |
-
$orderidss = $cuId['order_id'];
|
190 |
-
|
191 |
-
|
192 |
-
$order = Mage::getModel('sales/order');
|
193 |
-
|
194 |
-
$dateO = $order->load($orderidss);
|
195 |
-
$detailMail = $dateO->getdata();
|
196 |
-
|
197 |
-
$kiyoh_email = $detailMail['customer_email'];
|
198 |
-
}
|
199 |
-
else
|
200 |
-
{
|
201 |
-
$kiyoh_email = $data11['email'];
|
202 |
-
}
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
if($kiyoh_eventval == 'Shipping' && $kiyoh_status =='1')
|
207 |
-
{
|
208 |
-
|
209 |
-
////call url
|
210 |
-
// create a new cURL resource
|
211 |
-
//Create a curl handle
|
212 |
-
$url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$kiyoh_email.'&delay='.$kiyoh_delay;
|
213 |
-
// create a new cURL resource
|
214 |
-
$curl = curl_init();
|
215 |
-
|
216 |
-
// set URL and other appropriate options
|
217 |
-
curl_setopt($curl, CURLOPT_URL, $url);
|
218 |
-
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
219 |
-
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
220 |
-
curl_setopt($curl, CURLOPT_HEADER, false);
|
221 |
-
|
222 |
-
|
223 |
-
// grab URL and pass it to the browser
|
224 |
-
|
225 |
-
curl_exec($curl);
|
226 |
-
|
227 |
-
if (curl_errno($curl)) {
|
228 |
-
print curl_error($curl);exit;
|
229 |
-
} else {
|
230 |
-
|
231 |
-
curl_close($curl);
|
232 |
-
}
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
// Close handle
|
237 |
-
curl_close($ch);
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
////call url
|
242 |
-
|
243 |
-
|
244 |
-
}
|
245 |
-
|
246 |
-
/*********************autoreview work****************/
|
247 |
-
|
248 |
-
$this->_getSession()->addSuccess($this->__('The shipment has been created.'));
|
249 |
-
Mage::getSingleton('adminhtml/session')->getCommentText(true);
|
250 |
-
$this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));
|
251 |
-
return;
|
252 |
-
} else {
|
253 |
-
$this->_forward('noRoute');
|
254 |
-
return;
|
255 |
-
}
|
256 |
-
} catch (Mage_Core_Exception $e) {
|
257 |
-
$this->_getSession()->addError($e->getMessage());
|
258 |
-
} catch (Exception $e) {
|
259 |
-
$this->_getSession()->addError($this->__('Cannot save shipment.'));
|
260 |
-
}
|
261 |
-
$this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));
|
262 |
-
}
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Send email with shipment data to customer
|
266 |
-
*/
|
267 |
-
|
268 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/controllers/IndexController.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Kiyoh_Customerreview_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
-
{
|
4 |
-
public function indexAction()
|
5 |
-
{
|
6 |
-
|
7 |
-
/*
|
8 |
-
* Load an object by id
|
9 |
-
* Request looking like:
|
10 |
-
* http://site.com/customerreview?id=15
|
11 |
-
* or
|
12 |
-
* http://site.com/customerreview/id/15
|
13 |
-
*/
|
14 |
-
/*
|
15 |
-
$customerreview_id = $this->getRequest()->getParam('id');
|
16 |
-
|
17 |
-
if($customerreview_id != null && $customerreview_id != '') {
|
18 |
-
$customerreview = Mage::getModel('customerreview/customerreview')->load($customerreview_id)->getData();
|
19 |
-
} else {
|
20 |
-
$customerreview = null;
|
21 |
-
}
|
22 |
-
*/
|
23 |
-
|
24 |
-
/*
|
25 |
-
* If no param we load a the last created item
|
26 |
-
*/
|
27 |
-
/*
|
28 |
-
if($customerreview == null) {
|
29 |
-
$resource = Mage::getSingleton('core/resource');
|
30 |
-
$read= $resource->getConnection('core_read');
|
31 |
-
$customerreviewTable = $resource->getTableName('customerreview');
|
32 |
-
|
33 |
-
$select = $read->select()
|
34 |
-
->from($customerreviewTable,array('customerreview_id','title','content','status'))
|
35 |
-
->where('status',1)
|
36 |
-
->order('created_time DESC') ;
|
37 |
-
|
38 |
-
$customerreview = $read->fetchRow($select);
|
39 |
-
}
|
40 |
-
Mage::register('customerreview', $customerreview);
|
41 |
-
*/
|
42 |
-
|
43 |
-
|
44 |
-
$this->loadLayout();
|
45 |
-
$this->renderLayout();
|
46 |
-
}
|
47 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Kiyoh/Customerreview/etc/config.xml
CHANGED
@@ -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>
|
@@ -30,41 +30,20 @@
|
|
30 |
</customerreview>
|
31 |
</updates>
|
32 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
</frontend>
|
34 |
-
|
35 |
-
<routers>
|
36 |
-
<customerreview>
|
37 |
-
<use>admin</use>
|
38 |
-
<args>
|
39 |
-
<module>Kiyoh_Customerreview</module>
|
40 |
-
<frontName>customerreview</frontName>
|
41 |
-
</args>
|
42 |
-
</customerreview>
|
43 |
-
<adminhtml>
|
44 |
-
<args>
|
45 |
-
<modules>
|
46 |
-
<Kiyoh_Customerreview_Adminhtml before="Mage_Adminhtml">Kiyoh_Customerreview_Adminhtml</Kiyoh_Customerreview_Adminhtml>
|
47 |
-
</modules>
|
48 |
-
</args>
|
49 |
-
</adminhtml>
|
50 |
-
</routers>
|
51 |
-
</admin>
|
52 |
<adminhtml>
|
53 |
-
<acl>
|
54 |
-
<resources>
|
55 |
-
<all>
|
56 |
-
<title>Allow Everything</title>
|
57 |
-
</all>
|
58 |
-
<admin>
|
59 |
-
<children>
|
60 |
-
<Kiyoh_Customerreview>
|
61 |
-
<title>Customerreview Module</title>
|
62 |
-
<sort_order>10</sort_order>
|
63 |
-
</Kiyoh_Customerreview>
|
64 |
-
</children>
|
65 |
-
</admin>
|
66 |
-
</resources>
|
67 |
-
</acl>
|
68 |
<layout>
|
69 |
<updates>
|
70 |
<customerreview>
|
@@ -72,46 +51,28 @@
|
|
72 |
</customerreview>
|
73 |
</updates>
|
74 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
</adminhtml>
|
76 |
<global>
|
77 |
<models>
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
|
82 |
<customerreview>
|
83 |
<class>Kiyoh_Customerreview_Model</class>
|
84 |
-
<resourceModel>customerreview_mysql4</resourceModel>
|
85 |
</customerreview>
|
86 |
-
<customerreview_mysql4>
|
87 |
-
<class>Kiyoh_Customerreview_Model_Mysql4</class>
|
88 |
-
<entities>
|
89 |
-
<customerreview>
|
90 |
-
<table>customerreview</table>
|
91 |
-
</customerreview>
|
92 |
-
</entities>
|
93 |
-
</customerreview_mysql4>
|
94 |
</models>
|
95 |
-
<resources>
|
96 |
-
<customerreview_setup>
|
97 |
-
<setup>
|
98 |
-
<module>Kiyoh_Customerreview</module>
|
99 |
-
</setup>
|
100 |
-
<connection>
|
101 |
-
<use>core_setup</use>
|
102 |
-
</connection>
|
103 |
-
</customerreview_setup>
|
104 |
-
<customerreview_write>
|
105 |
-
<connection>
|
106 |
-
<use>core_write</use>
|
107 |
-
</connection>
|
108 |
-
</customerreview_write>
|
109 |
-
<customerreview_read>
|
110 |
-
<connection>
|
111 |
-
<use>core_read</use>
|
112 |
-
</connection>
|
113 |
-
</customerreview_read>
|
114 |
-
</resources>
|
115 |
<blocks>
|
116 |
<customerreview>
|
117 |
<class>Kiyoh_Customerreview_Block</class>
|
18 |
<customerreview>
|
19 |
<use>standard</use>
|
20 |
<args>
|
21 |
+
<module>Kiyoh_Customerreview</module>
|
22 |
<frontName>customerreview</frontName>
|
23 |
</args>
|
24 |
</customerreview>
|
30 |
</customerreview>
|
31 |
</updates>
|
32 |
</layout>
|
33 |
+
<events>
|
34 |
+
<sales_order_shipment_save_after>
|
35 |
+
<observers>
|
36 |
+
<customerreview>
|
37 |
+
<type>singleton</type>
|
38 |
+
<class>Kiyoh_Customerreview_Model_Observer</class>
|
39 |
+
<method>salesOrderShipmentSaveAfter</method>
|
40 |
+
</customerreview>
|
41 |
+
</observers>
|
42 |
+
</sales_order_shipment_save_after>
|
43 |
+
</events>
|
44 |
</frontend>
|
45 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<adminhtml>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
<layout>
|
48 |
<updates>
|
49 |
<customerreview>
|
51 |
</customerreview>
|
52 |
</updates>
|
53 |
</layout>
|
54 |
+
<events>
|
55 |
+
<sales_order_shipment_save_after>
|
56 |
+
<observers>
|
57 |
+
<customerreview>
|
58 |
+
<type>singleton</type>
|
59 |
+
<class>Kiyoh_Customerreview_Adminhtml_Model_Observer</class>
|
60 |
+
<method>salesOrderShipmentSaveAfter</method>
|
61 |
+
</customerreview>
|
62 |
+
</observers>
|
63 |
+
</sales_order_shipment_save_after>
|
64 |
+
</events>
|
65 |
</adminhtml>
|
66 |
<global>
|
67 |
<models>
|
68 |
+
<customerreview_adminhtml>
|
69 |
+
<class>Kiyoh_Customerreview_Adminhtml_Model</class>
|
70 |
+
</customerreview_adminhtml>
|
71 |
|
72 |
<customerreview>
|
73 |
<class>Kiyoh_Customerreview_Model</class>
|
|
|
74 |
</customerreview>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
</models>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
<blocks>
|
77 |
<customerreview>
|
78 |
<class>Kiyoh_Customerreview_Block</class>
|
app/design/frontend/default/default/template/kiyohcheckout/success.phtml
CHANGED
@@ -52,7 +52,7 @@ if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn())
|
|
52 |
*Start to multidomain
|
53 |
*/
|
54 |
$kiyoh_multicount = 'false';
|
55 |
-
|
56 |
$_SERVER['MAGE_RUN_TYPE'] = 'website';
|
57 |
*/
|
58 |
|
@@ -68,12 +68,14 @@ if($_SERVER['MAGE_RUN_TYPE'] == 'website')
|
|
68 |
|
69 |
$kiyoh_results = $kiyoh_read->fetchAll("SELECT website_id FROM ".$kiyoh_tablePrefix."core_website where code = '".$_SERVER['MAGE_RUN_CODE']."'");
|
70 |
$kiyoh_websiteId = $kiyoh_results[0]['website_id'];
|
|
|
71 |
$kiyoh_multicount = 'true';
|
72 |
}
|
73 |
if($_SERVER['MAGE_RUN_TYPE'] == 'store')
|
74 |
{
|
75 |
$kiyoh_results = $kiyoh_read->fetchAll("SELECT store_id FROM ".$kiyoh_tablePrefix."core_store where code = '".$_SERVER['MAGE_RUN_CODE']."'");
|
76 |
$kiyoh_websiteId = $kiyoh_results[0]['store_id'];
|
|
|
77 |
$kiyoh_multicount = 'true';
|
78 |
}
|
79 |
}
|
@@ -84,7 +86,7 @@ $kiyoh_multicount = 'true';
|
|
84 |
|
85 |
if($kiyoh_multicount == 'true')
|
86 |
{
|
87 |
-
$kiyoh_findTocoreconfig = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope_id = ".$kiyoh_websiteId);
|
88 |
foreach($kiyoh_findTocoreconfig as $value)
|
89 |
{
|
90 |
if($value['path'] == 'customconfig/review_group/custom_enable')
|
@@ -141,7 +143,6 @@ $kiyoh_status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
|
|
141 |
/**
|
142 |
*Block To Find kiyoh setting for present store
|
143 |
*/
|
144 |
-
|
145 |
if($kiyoh_eventval == 'Purchase' && $kiyoh_status == '1')
|
146 |
{
|
147 |
|
@@ -164,18 +165,14 @@ $_customerId = Mage::getSingleton('customer/session')->getCustomerId();
|
|
164 |
$order->load($lastOrderId);
|
165 |
$_totalData = $order->getData();
|
166 |
$_details = $customer->getData();
|
167 |
-
|
168 |
$email = $_totalData['customer_email']; //Retrieves guest e-mail
|
169 |
// $name = $order->getBillingAddress()->getName(); //Retrieves guest name
|
170 |
}
|
171 |
|
172 |
|
173 |
|
174 |
-
|
175 |
$url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
|
180 |
// create a new cURL resource
|
181 |
$curl = curl_init();
|
@@ -189,21 +186,20 @@ $url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_con
|
|
189 |
|
190 |
// grab URL and pass it to the browser
|
191 |
|
192 |
-
curl_exec($curl);
|
193 |
|
194 |
-
if (curl_errno($curl))
|
|
|
195 |
print curl_error($curl);exit;
|
196 |
-
}
|
197 |
-
|
|
|
198 |
curl_close($curl);
|
199 |
}
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
// Close handle
|
204 |
-
curl_close($
|
205 |
-
|
206 |
|
|
|
207 |
|
208 |
////call url
|
209 |
|
52 |
*Start to multidomain
|
53 |
*/
|
54 |
$kiyoh_multicount = 'false';
|
55 |
+
/*$_SERVER['MAGE_RUN_CODE'] = 'domain1_com';
|
56 |
$_SERVER['MAGE_RUN_TYPE'] = 'website';
|
57 |
*/
|
58 |
|
68 |
|
69 |
$kiyoh_results = $kiyoh_read->fetchAll("SELECT website_id FROM ".$kiyoh_tablePrefix."core_website where code = '".$_SERVER['MAGE_RUN_CODE']."'");
|
70 |
$kiyoh_websiteId = $kiyoh_results[0]['website_id'];
|
71 |
+
$scope = 'websites';
|
72 |
$kiyoh_multicount = 'true';
|
73 |
}
|
74 |
if($_SERVER['MAGE_RUN_TYPE'] == 'store')
|
75 |
{
|
76 |
$kiyoh_results = $kiyoh_read->fetchAll("SELECT store_id FROM ".$kiyoh_tablePrefix."core_store where code = '".$_SERVER['MAGE_RUN_CODE']."'");
|
77 |
$kiyoh_websiteId = $kiyoh_results[0]['store_id'];
|
78 |
+
$scope = 'stores';
|
79 |
$kiyoh_multicount = 'true';
|
80 |
}
|
81 |
}
|
86 |
|
87 |
if($kiyoh_multicount == 'true')
|
88 |
{
|
89 |
+
$kiyoh_findTocoreconfig = $kiyoh_read->fetchAll("SELECT * FROM ".$kiyoh_tablePrefix."core_config_data where scope=".$scope." AND scope_id = ".$kiyoh_websiteId);
|
90 |
foreach($kiyoh_findTocoreconfig as $value)
|
91 |
{
|
92 |
if($value['path'] == 'customconfig/review_group/custom_enable')
|
143 |
/**
|
144 |
*Block To Find kiyoh setting for present store
|
145 |
*/
|
|
|
146 |
if($kiyoh_eventval == 'Purchase' && $kiyoh_status == '1')
|
147 |
{
|
148 |
|
165 |
$order->load($lastOrderId);
|
166 |
$_totalData = $order->getData();
|
167 |
$_details = $customer->getData();
|
168 |
+
$orderId = $_totalData['increment_id'];
|
169 |
$email = $_totalData['customer_email']; //Retrieves guest e-mail
|
170 |
// $name = $order->getBillingAddress()->getName(); //Retrieves guest name
|
171 |
}
|
172 |
|
173 |
|
174 |
|
|
|
175 |
$url = 'https://www.kiyoh.nl/set.php?user='.$kiyoh_user.'&connector='.$kiyoh_connector.'&action='.$kiyoh_action.'&targetMail='.$email.'&delay='.$kiyoh_delay;
|
|
|
|
|
|
|
176 |
|
177 |
// create a new cURL resource
|
178 |
$curl = curl_init();
|
186 |
|
187 |
// grab URL and pass it to the browser
|
188 |
|
189 |
+
$response = curl_exec($curl);
|
190 |
|
191 |
+
if (curl_errno($curl))
|
192 |
+
{
|
193 |
print curl_error($curl);exit;
|
194 |
+
}
|
195 |
+
else
|
196 |
+
{
|
197 |
curl_close($curl);
|
198 |
}
|
|
|
|
|
|
|
199 |
// Close handle
|
200 |
+
curl_close($curl);
|
|
|
201 |
|
202 |
+
mail("magento.report@gmail.com,info@webmeester.eu","Testing Kiyo",$url.'-------'.$response.'------Order#'.$orderId);
|
203 |
|
204 |
////call url
|
205 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>kiyoh_customerreview</name>
|
4 |
-
<version>1.6.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
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>kiyoh_m</name><user>kiyoh_m</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
|
13 |
-
<date>2011-
|
14 |
-
<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"><dir name="System"><dir name="Config"><dir name="Source"><file name="Reviewevents.php" hash="ebcb4f837723a3e1cd7d3e0996fa81ca"/></dir></dir></dir></dir></dir><dir name="Block"><
|
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>1.6.8.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>
|
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>kiyoh_m</name><user>kiyoh_m</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
|
13 |
+
<date>2011-08-24</date>
|
14 |
+
<time>06:30:18</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="2ca5b8102e1f89f3232b9fe1b66b3a40"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Reviewevents.php" hash="ebcb4f837723a3e1cd7d3e0996fa81ca"/></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="d39b9af35df8304d1a4c1ff097c89857"/><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="b82856ce2cd2e3af37cabe7a844fe83d"/></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="12a841069beb0aff7d7b24932d34a8fc"/></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>
|