Magmodules_Trustpilot - Version 1.0.0

Version Notes

First stable release

Download this release

Release Info

Developer Magento Core Team
Extension Magmodules_Trustpilot
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (61) hide show
  1. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotlog.php +39 -0
  2. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotlog/Grid.php +126 -0
  3. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews.php +39 -0
  4. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews/Grid.php +144 -0
  5. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews/Renderer/Experience.php +36 -0
  6. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Buttons/Process.php +38 -0
  7. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Form/Heading.php +31 -0
  8. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Log.php +55 -0
  9. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Seconds.php +34 -0
  10. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Stars.php +30 -0
  11. app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Info/Info.php +55 -0
  12. app/code/local/Magmodules/Trustpilot/Block/Custom.php +39 -0
  13. app/code/local/Magmodules/Trustpilot/Block/Reviews.php +64 -0
  14. app/code/local/Magmodules/Trustpilot/Block/Sidebar.php +134 -0
  15. app/code/local/Magmodules/Trustpilot/Block/Snippets.php +47 -0
  16. app/code/local/Magmodules/Trustpilot/Helper/Data.php +54 -0
  17. app/code/local/Magmodules/Trustpilot/Model/Api.php +66 -0
  18. app/code/local/Magmodules/Trustpilot/Model/Log.php +61 -0
  19. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Log.php +28 -0
  20. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Log/Collection.php +29 -0
  21. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Reviews.php +28 -0
  22. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Reviews/Collection.php +29 -0
  23. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Stats.php +28 -0
  24. app/code/local/Magmodules/Trustpilot/Model/Mysql4/Stats/Collection.php +29 -0
  25. app/code/local/Magmodules/Trustpilot/Model/Observer.php +87 -0
  26. app/code/local/Magmodules/Trustpilot/Model/Reviews.php +132 -0
  27. app/code/local/Magmodules/Trustpilot/Model/Stats.php +115 -0
  28. app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Cronfrequency.php +35 -0
  29. app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Orderstatus.php +39 -0
  30. app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Position.php +31 -0
  31. app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Sidebarlink.php +32 -0
  32. app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Sidebarstyle.php +31 -0
  33. app/code/local/Magmodules/Trustpilot/controllers/Adminhtml/TrustpilotlogController.php +67 -0
  34. app/code/local/Magmodules/Trustpilot/controllers/Adminhtml/TrustpilotreviewsController.php +147 -0
  35. app/code/local/Magmodules/Trustpilot/controllers/IndexController.php +51 -0
  36. app/code/local/Magmodules/Trustpilot/etc/adminhtml.xml +92 -0
  37. app/code/local/Magmodules/Trustpilot/etc/config.xml +195 -0
  38. app/code/local/Magmodules/Trustpilot/etc/system.xml +464 -0
  39. app/code/local/Magmodules/Trustpilot/sql/trustpilot_setup/mysql4-install-0.9.0.php +83 -0
  40. app/code/local/Magmodules/Trustpilot/sql/trustpilot_setup/mysql4-upgrade-0.9.0-1.0.0.php +27 -0
  41. app/design/adminhtml/default/default/layout/magmodules_trustpilot.xml +16 -0
  42. app/design/frontend/base/default/layout/magmodules_trustpilot.xml +36 -0
  43. app/design/frontend/base/default/template/magmodules/trustpilot/index.phtml +82 -0
  44. app/design/frontend/base/default/template/magmodules/trustpilot/sidebar/left.phtml +108 -0
  45. app/design/frontend/base/default/template/magmodules/trustpilot/sidebar/right.phtml +108 -0
  46. app/design/frontend/base/default/template/magmodules/trustpilot/widget/custom.phtml +39 -0
  47. app/design/frontend/base/default/template/magmodules/trustpilot/widget/richsnippets.phtml +34 -0
  48. app/etc/modules/Magmodules_Trustpilot.xml +9 -0
  49. app/locale/en_US/Magmodules_Trustpilot.csv +114 -0
  50. app/locale/nl_NL/Magmodules_Trustpilot.csv +113 -0
  51. package.xml +18 -0
  52. skin/adminhtml/default/default/magmodules/trustpilot/grid.css +71 -0
  53. skin/adminhtml/default/default/magmodules/trustpilot/star.png +0 -0
  54. skin/frontend/base/default/magmodules/trustpilot/images/5-stars-empty.png +0 -0
  55. skin/frontend/base/default/magmodules/trustpilot/images/5-stars-full.png +0 -0
  56. skin/frontend/base/default/magmodules/trustpilot/images/greystar.png +0 -0
  57. skin/frontend/base/default/magmodules/trustpilot/images/logo.png +0 -0
  58. skin/frontend/base/default/magmodules/trustpilot/images/star.png +0 -0
  59. skin/frontend/base/default/magmodules/trustpilot/richsnippets.css +41 -0
  60. skin/frontend/base/default/magmodules/trustpilot/sidebar.css +309 -0
  61. skin/frontend/base/default/magmodules/trustpilot/style.css +119 -0
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotlog.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Trustpilotlog extends Mage_Adminhtml_Block_Widget_Grid_Container {
23
+
24
+ public function __construct() {
25
+ $this->_controller = 'adminhtml_trustpilotlog';
26
+ $this->_blockGroup = 'trustpilot';
27
+ $this->_headerText = Mage::helper('trustpilot')->__('Trustpilot Logs');
28
+ parent::__construct();
29
+ $this->_removeButton('add');
30
+
31
+ $this->_addButton('module_controller', array(
32
+ 'label' => Mage::helper('trustpilot')->__('Cleanup Log'),
33
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/trustpilotlog/clean')}')",
34
+ 'confirm' => Mage::helper('trustpilot')->__('Are you sure you want to cleanup logfiles?'),
35
+ ));
36
+
37
+ }
38
+
39
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotlog/Grid.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Feedbackcompany
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Trustpilotlog_Grid extends Mage_Adminhtml_Block_Widget_Grid {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+ $this->setId('trustpilotGrid');
27
+ $this->setDefaultSort('date');
28
+ $this->setDefaultDir('DESC');
29
+ $this->setSaveParametersInSession(true);
30
+ }
31
+
32
+ protected function _prepareCollection() {
33
+ $collection = Mage::getModel('trustpilot/log')->getCollection();
34
+ $this->setCollection($collection);
35
+ return parent::_prepareCollection();
36
+ }
37
+
38
+ protected function _prepareColumns() {
39
+
40
+ $this->addColumn('company', array(
41
+ 'header' => Mage::helper('trustpilot')->__('Shop'),
42
+ 'index' => 'company',
43
+ 'width' => '120px',
44
+ ));
45
+
46
+ $this->addColumn('type', array(
47
+ 'header' => Mage::helper('trustpilot')->__('Type'),
48
+ 'align' => 'left',
49
+ 'index' => 'type',
50
+ 'width' => '120',
51
+ 'type' => 'options',
52
+ 'options' => array(
53
+ 'reviews' => Mage::helper('trustpilot')->__('Reviews'),
54
+ 'invitation' => Mage::helper('trustpilot')->__('Invitation Call'),
55
+ ),
56
+ ));
57
+
58
+ if(Mage::app()->getRequest()->getParam('showapiurl')) {
59
+ $this->addColumn('api_url', array(
60
+ 'header' => Mage::helper('trustpilot')->__('Api URL'),
61
+ 'align' => 'left',
62
+ 'index' => 'api_url',
63
+ 'filter' => false,
64
+ 'sortable' => false,
65
+ ));
66
+ }
67
+
68
+ $this->addColumn('qty', array(
69
+ 'header' => Mage::helper('trustpilot')->__('Description'),
70
+ 'align' => 'left',
71
+ 'index' => 'qty',
72
+ 'renderer' => 'trustpilot/adminhtml_widget_grid_log',
73
+ 'filter' => false,
74
+ 'sortable' => false,
75
+ ));
76
+
77
+ $this->addColumn('cron', array(
78
+ 'header' => Mage::helper('trustpilot')->__('Cron'),
79
+ 'align' => 'left',
80
+ 'index' => 'cron',
81
+ 'width' => '120',
82
+ 'type' => 'options',
83
+ 'options' => array(
84
+ '' => Mage::helper('trustpilot')->__('Manual'),
85
+ 'stats' => Mage::helper('trustpilot')->__('Stats Cron'),
86
+ 'reviews' => Mage::helper('trustpilot')->__('Reviews Cron'),
87
+ 'orderupdate' => Mage::helper('trustpilot')->__('Invitation'),
88
+ ),
89
+ ));
90
+
91
+ $this->addColumn('time', array(
92
+ 'header' => Mage::helper('trustpilot')->__('Time'),
93
+ 'align' => 'left',
94
+ 'index' => 'time',
95
+ 'width' => '60',
96
+ 'renderer' => 'trustpilot/adminhtml_widget_grid_seconds',
97
+ ));
98
+
99
+ $this->addColumn('date', array(
100
+ 'header' => Mage::helper('trustpilot')->__('Date'),
101
+ 'align' => 'left',
102
+ 'type' => 'datetime',
103
+ 'index' => 'date',
104
+ 'width' => '140',
105
+ ));
106
+
107
+ return parent::_prepareColumns();
108
+ }
109
+
110
+ protected function _prepareMassaction() {
111
+ $this->setMassactionIdField('id');
112
+ $this->getMassactionBlock()->setFormFieldName('logids');
113
+
114
+ $this->getMassactionBlock()->addItem('hide', array(
115
+ 'label' => Mage::helper('trustpilot')->__('Delete'),
116
+ 'url' => $this->getUrl('*/*/massDelete'),
117
+ ));
118
+ return $this;
119
+ }
120
+
121
+ public function getRowUrl($row)
122
+ {
123
+ return;
124
+ }
125
+
126
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Trustpilotreviews extends Mage_Adminhtml_Block_Widget_Grid_Container {
23
+
24
+ public function __construct() {
25
+ $this->_controller = 'adminhtml_trustpilotreviews';
26
+ $this->_blockGroup = 'trustpilot';
27
+ $this->_headerText = Mage::helper('trustpilot')->__('Trustpilot Reviews');
28
+ parent::__construct();
29
+ $this->_removeButton('add');
30
+
31
+ $this->_addButton('module_controller', array(
32
+ 'label' => Mage::helper('trustpilot')->__('Delete all reviews'),
33
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/trustpilotreviews/truncate')}')",
34
+ 'confirm' => Mage::helper('trustpilot')->__('Are you sure you want to delete all reviews?'),
35
+ ));
36
+
37
+ }
38
+
39
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews/Grid.php ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Trustpilotreviews_Grid extends Mage_Adminhtml_Block_Widget_Grid {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+ $this->setId('reviewsGrid');
27
+ $this->setDefaultSort('date_created');
28
+ $this->setDefaultDir('DESC');
29
+ $this->setSaveParametersInSession(true);
30
+ }
31
+
32
+ protected function _prepareCollection() {
33
+ $collection = Mage::getModel('trustpilot/reviews')->getCollection();
34
+ $this->setCollection($collection);
35
+ return parent::_prepareCollection();
36
+ }
37
+
38
+ protected function _prepareColumns() {
39
+
40
+ $this->addColumn('company', array(
41
+ 'header' => Mage::helper('trustpilot')->__('Shop'),
42
+ 'index' => 'company',
43
+ 'width' => '120px',
44
+ ));
45
+
46
+ $this->addColumn('user_name', array(
47
+ 'header' => Mage::helper('trustpilot')->__('User'),
48
+ 'align' => 'left',
49
+ 'index' => 'user_name',
50
+ ));
51
+
52
+ $this->addColumn('title', array(
53
+ 'header' => Mage::helper('trustpilot')->__('Title'),
54
+ 'align' => 'left',
55
+ 'index' => 'title',
56
+ ));
57
+
58
+ $this->addColumn('content', array(
59
+ 'header' => Mage::helper('trustpilot')->__('Review'),
60
+ 'align' => 'left',
61
+ 'index' => 'content',
62
+ 'renderer' => 'trustpilot/adminhtml_trustpilotreviews_renderer_experience',
63
+ ));
64
+
65
+ $this->addColumn('stars_url_small', array(
66
+ 'header' => Mage::helper('trustpilot')->__('Score'),
67
+ 'align' => 'left',
68
+ 'index' => 'stars_url_small',
69
+ 'renderer' => 'trustpilot/adminhtml_widget_grid_stars',
70
+ 'width' => '110',
71
+ 'filter' => false,
72
+ 'sortable' => true,
73
+ ));
74
+
75
+
76
+ $this->addColumn('user_locale', array(
77
+ 'header' => Mage::helper('trustpilot')->__('Locale'),
78
+ 'align' => 'left',
79
+ 'index' => 'user_locale',
80
+ ));
81
+
82
+ $this->addColumn('date_created', array(
83
+ 'header' => Mage::helper('trustpilot')->__('Date'),
84
+ 'align' => 'left',
85
+ 'type' => 'date',
86
+ 'index' => 'date_created',
87
+ 'width' => '140',
88
+ ));
89
+
90
+ $this->addColumn('sidebar', array(
91
+ 'header' => Mage::helper('trustpilot')->__('Sidebar'),
92
+ 'align' => 'left',
93
+ 'width' => '80px',
94
+ 'index' => 'sidebar',
95
+ 'type' => 'options',
96
+ 'options' => array(
97
+ 0 => Mage::helper('trustpilot')->__('No'),
98
+ 1 => Mage::helper('trustpilot')->__('Yes'),
99
+ ),
100
+ ));
101
+
102
+ $this->addColumn('status', array(
103
+ 'header' => Mage::helper('trustpilot')->__('Active'),
104
+ 'align' => 'left',
105
+ 'width' => '80px',
106
+ 'index' => 'status',
107
+ 'type' => 'options',
108
+ 'options' => array(
109
+ 0 => Mage::helper('trustpilot')->__('No'),
110
+ 1 => Mage::helper('trustpilot')->__('Yes'),
111
+ ),
112
+ ));
113
+
114
+ return parent::_prepareColumns();
115
+ }
116
+
117
+ protected function _prepareMassaction() {
118
+ $this->setMassactionIdField('review_id');
119
+ $this->getMassactionBlock()->setFormFieldName('reviewids');
120
+
121
+ $this->getMassactionBlock()->addItem('hide', array(
122
+ 'label' => Mage::helper('trustpilot')->__('Set to invisible'),
123
+ 'url' => $this->getUrl('*/*/massDisable'),
124
+ ));
125
+ $this->getMassactionBlock()->addItem('visible', array(
126
+ 'label' => Mage::helper('trustpilot')->__('Set to visible'),
127
+ 'url' => $this->getUrl('*/*/massEnable'),
128
+ ));
129
+ $this->getMassactionBlock()->addItem('addsidebar', array(
130
+ 'label' => Mage::helper('trustpilot')->__('Add to Sidebar'),
131
+ 'url' => $this->getUrl('*/*/massEnableSidebar'),
132
+ ));
133
+ $this->getMassactionBlock()->addItem('removesidebar', array(
134
+ 'label' => Mage::helper('trustpilot')->__('Remove from Sidebar'),
135
+ 'url' => $this->getUrl('*/*/massDisableSidebar'),
136
+ ));
137
+ return $this;
138
+ }
139
+
140
+ public function getRowUrl($row) {
141
+ return false;
142
+ }
143
+
144
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Trustpilotreviews/Renderer/Experience.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Trustpilotreviews_Renderer_Experience extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $value = $row->getData($this->getColumn()->getIndex());
26
+ $char_limit = '100';
27
+ if(strlen($value) > $char_limit) {
28
+ $content_small = Mage::helper('core/string')->truncate($value, $char_limit, ' ... <a href="#" class="magtooltip" alt="">(meer)', $_remainder, true);
29
+ $content = $content_small . '<span>' . $value . '</span></a>';
30
+ return $content;
31
+ } else {
32
+ return $value;
33
+ }
34
+ }
35
+
36
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Buttons/Process.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Buttons_Process extends Mage_Adminhtml_Block_System_Config_Form_Field {
23
+
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
25
+ $this->setElement($element);
26
+ $url = $this->getUrl('*/trustpilotreviews/process');
27
+
28
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
29
+ ->setType('button')
30
+ ->setClass('scalable')
31
+ ->setLabel(Mage::helper('trustpilot')->__('Process Manually'))
32
+ ->setOnClick("setLocation('$url')")
33
+ ->toHtml();
34
+
35
+ return $html;
36
+ }
37
+
38
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Form/Heading.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Form_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
+
24
+ public function render(Varien_Data_Form_Element_Abstract $element) {
25
+ $useContainerId = $element->getData('use_container_id');
26
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
27
+ $element->getHtmlId(), $element->getLabel()
28
+ );
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Log.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
4
+ * =============================================================
5
+ * NOTICE OF LICENSE [Single domain license]
6
+ * This source file is subject to the EULA that is
7
+ * available through the world-wide-web at:
8
+ * http://www.magmodules.eu/license-agreement/
9
+ * =============================================================
10
+ * @category Magmodules
11
+ * @package Magmodules_Shopreview
12
+ * @author Magmodules <info@magmodules.eu>
13
+ * @copyright Copyright (c) 2013 (http://www.magmodules.eu)
14
+ * @license http://www.magmodules.eu/license-agreement/
15
+ * =============================================================
16
+ */
17
+
18
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Grid_Log extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
19
+
20
+ public function render(Varien_Object $row) {
21
+ $type = $row->getType();
22
+ $msg = '';
23
+
24
+ if($type == 'reviews') {
25
+ $updates = '';
26
+ if($row->getReviewNew() > 0) {
27
+ $msg .= Mage::helper('trustpilot')->__('%s new review(s)', $row->getReviewNew());
28
+ $updates++;
29
+ }
30
+ if($row->getReviewUpdate() > 0) {
31
+ if($updates > 0) {
32
+ $msg .= ', ';
33
+ }
34
+ $msg .= Mage::helper('trustpilot')->__('%s review(s) updated', $row->getReviewUpdate());
35
+ $updates++;
36
+ }
37
+ if($updates > 0) {
38
+ $msg .= ' & ';
39
+ }
40
+ $msg .= Mage::helper('trustpilot')->__('total score updated');
41
+ }
42
+
43
+ if($type == 'invitation') {
44
+ if($row->getOrderId()) {
45
+ $order = Mage::getModel('sales/order')->load($row->getOrderId());
46
+ $increment_id = $order->getIncrementId();
47
+ $order_url = Mage::helper('adminhtml')->getUrl("adminhtml/sales_order/view", array('order_id'=> $row->getOrderId()));
48
+ $msg = Mage::helper('trustpilot')->__('%s - Repsonse: %s', '<a href="' . $order_url . '">#' . $increment_id .'</a>', $row->getResponse());
49
+ }
50
+ }
51
+
52
+ return ucfirst($msg);
53
+ }
54
+
55
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Seconds.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Grid_Seconds extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $value = $row->getData($this->getColumn()->getIndex());
26
+
27
+ if($value > 0) {
28
+ $value = number_format($value, 3, '.', '');
29
+ }
30
+
31
+ return $value;
32
+ }
33
+
34
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Grid/Stars.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Grid_Stars extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $value = $row->getData($this->getColumn()->getIndex());
26
+ $output = '<img src="' . $value . '" alt="review stars" class="trustpilot-review-stars"/>';
27
+ return $output;
28
+ }
29
+
30
+ }
app/code/local/Magmodules/Trustpilot/Block/Adminhtml/Widget/Info/Info.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Trustpilot_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
24
+
25
+ public function render(Varien_Data_Form_Element_Abstract $element) {
26
+ $html = '<div style="background:url(\'http://www.magmodules.eu/_logo.png\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
27
+ <h4>About Magmodules.eu</h4>
28
+ <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
29
+ <br />
30
+ <table width="525" border="0">
31
+ <tr>
32
+ <td width="64%">View more extensions from us:</td>
33
+ <td width="36%"><a href="http://www.magentocommerce.com/magento-connect/developer/Magmodules" target="_blank">Magento Connect</a></td>
34
+ </tr>
35
+ <tr>
36
+ <td width="64%">Contact:</td>
37
+ <td width="36%"><a href="mailto:info@magmodules.eu">info@magmodules.eu</a></td>
38
+ </tr>
39
+ <tr>
40
+ <td width="64%">Visit our website:</td>
41
+ <td width="36%"><a href="http://www.magmodules.eu" target="_blank">www.magmodules.eu</a></td>
42
+ </tr>
43
+ <tr>
44
+ <td>&nbsp;</td>
45
+ <td>&nbsp;</td>
46
+ </tr>
47
+ <tr>
48
+ <td colspan="2"><b><a href="http://www.magmodules.eu/help/trustpilot/">Click Here To Go The Configuration Manual</a></b></td>
49
+ </tr>
50
+ </table>
51
+ </div>';
52
+ return $html;
53
+ }
54
+
55
+ }
app/code/local/Magmodules/Trustpilot/Block/Custom.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Custom extends Mage_Core_Block_Template {
23
+
24
+ protected function _construct() {
25
+ if(Mage::getStoreConfig('trustpilot/general/enabled')) {
26
+ $this->setTrustpilotEnabled(1);
27
+ } else {
28
+ $this->setTrustpilotEnabled(0);
29
+ }
30
+
31
+ parent::_construct();
32
+ $this->setTemplate('magmodules/trustpilot/widget/custom.phtml');
33
+ }
34
+
35
+ public function getTrustpilotData() {
36
+ return $this->helper('trustpilot')->getTotalScore();
37
+ }
38
+
39
+ }
app/code/local/Magmodules/Trustpilot/Block/Reviews.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Reviews extends Mage_Core_Block_Template {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+
27
+ // Load Reviews
28
+ $collection = Mage::getModel('trustpilot/reviews')->getCollection();
29
+ $collection->setOrder('date_created', 'DESC');
30
+ $collection->addFieldToFilter('status',1);
31
+ $collection->addFieldToFilter('shop_id', Mage::getStoreConfig('trustpilot/general/api_id'));
32
+ $this->setReviews($collection);
33
+
34
+ // Load Stats
35
+ $stats = Mage::getModel('trustpilot/stats')->load(Mage::getStoreConfig('trustpilot/general/api_id'), 'shop_id');
36
+ $this->setStats($stats);
37
+ }
38
+
39
+ public function _prepareLayout() {
40
+ parent::_prepareLayout();
41
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'trustpilot.pager');
42
+ if(Mage::getStoreConfig('trustpilot/overview/enable_paging')) {
43
+ $fieldPerPage = Mage::getStoreConfig('trustpilot/overview/paging_settings');
44
+ $fieldPerPage = explode(',', $fieldPerPage);
45
+ $fieldPerPage = array_combine($fieldPerPage, $fieldPerPage);
46
+ $pager->setAvailableLimit($fieldPerPage);
47
+ } else {
48
+ $pager->setAvailableLimit(array('all'=>'all'));
49
+ }
50
+ $pager->setCollection($this->getReviews());
51
+ $this->setChild('pager', $pager);
52
+ $this->getReviews()->load();
53
+ return $this;
54
+ }
55
+
56
+ public function getPagerHtml() {
57
+ return $this->getChildHtml('pager');
58
+ }
59
+
60
+ public function getFormUrl() {
61
+ return $this->helper('trustpilot')->getFormUrl();
62
+ }
63
+
64
+ }
app/code/local/Magmodules/Trustpilot/Block/Sidebar.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Sidebar extends Mage_Core_Block_Template {
23
+
24
+ protected function _construct() {
25
+ parent::_construct();
26
+ }
27
+
28
+ function getSidebarCollection($sidebar) {
29
+
30
+ $enabled = '';
31
+ $qty = '5';
32
+
33
+ if(Mage::getStoreConfig('trustpilot/general/enabled')):
34
+ if($sidebar == 'left'):
35
+ $qty = Mage::getStoreConfig('trustpilot/sidebar/left_qty');
36
+ $enabled = Mage::getStoreConfig('trustpilot/sidebar/left');
37
+ endif;
38
+ if($sidebar == 'right'):
39
+ $qty = Mage::getStoreConfig('trustpilot/sidebar/right_qty');
40
+ $enabled = Mage::getStoreConfig('trustpilot/sidebar/right');
41
+ endif;
42
+ endif;
43
+
44
+ if($enabled):
45
+ $shop_id = Mage::getStoreConfig('trustpilot/general/api_id');
46
+ $collection = Mage::getModel("trustpilot/reviews")->getCollection();
47
+ $collection->setOrder('date_created', 'DESC');
48
+ $collection->addFieldToFilter('status',1);
49
+ $collection->addFieldToFilter('sidebar',1);
50
+ $collection->addFieldToFilter('shop_id', array('eq'=> array($shop_id)));
51
+ $collection->setPageSize($qty);
52
+ $collection->load();
53
+ return $collection;
54
+ else:
55
+ return false;
56
+ endif;
57
+ }
58
+
59
+ function formatContent($sidebarreview, $sidebar = 'left') {
60
+
61
+ $content = $sidebarreview->getContent();
62
+
63
+ if($sidebar == 'left'):
64
+ $char_limit = Mage::getStoreConfig('trustpilot/sidebar/left_lenght');
65
+ endif;
66
+ if($sidebar == 'right'):
67
+ $char_limit = Mage::getStoreConfig('trustpilot/sidebar/right_lenght');
68
+ endif;
69
+
70
+ $content = Mage::helper('core/string')->truncate($content, $char_limit, ' ...', $_remainder, false);
71
+ $content .= ' <a href="' . $sidebarreview->getUrl() . '" target="_blank">' . $this->__('Read More') . '</a>';
72
+ return $content;
73
+
74
+ }
75
+
76
+ function getReviewsUrl($sidebar = 'left') {
77
+
78
+ if($sidebar == 'left'):
79
+ $link = Mage::getStoreConfig('trustpilot/sidebar/left_link');
80
+ endif;
81
+ if($sidebar == 'right'):
82
+ $link = Mage::getStoreConfig('trustpilot/sidebar/left_right');
83
+ endif;
84
+
85
+ if($link == 'internal'):
86
+ $url = $this->getUrl('trustpilot');
87
+ endif;
88
+ if($link == 'external'):
89
+ $url = Mage::getStoreConfig('trustpilot/general/url');
90
+ endif;
91
+
92
+ if($url) {
93
+ return $url;
94
+ } else {
95
+ return '#';
96
+ }
97
+
98
+ }
99
+
100
+ public function getSnippetsEnabled($sidebar = 'left') {
101
+
102
+ if($sidebar == 'left'):
103
+ $enabled = Mage::getStoreConfig('trustpilot/sidebar/left_snippets');
104
+ endif;
105
+ if($sidebar == 'right'):
106
+ $enabled = Mage::getStoreConfig('trustpilot/sidebar/right_snippets');
107
+ endif;
108
+
109
+ $homepage = Mage::getBlockSingleton('page/html_header')->getIsHomePage();
110
+
111
+ if($enabled && $homepage) {
112
+ return true;
113
+ } else {
114
+ return false;
115
+ }
116
+ }
117
+
118
+ public function getSidebarStyle($sidebar = 'left') {
119
+
120
+ if($sidebar == 'left'):
121
+ $style = Mage::getStoreConfig('trustpilot/sidebar/left_style');
122
+ endif;
123
+ if($sidebar == 'right'):
124
+ $style = Mage::getStoreConfig('trustpilot/sidebar/right_style');
125
+ endif;
126
+
127
+ return $style;
128
+ }
129
+
130
+ public function getTotalScore() {
131
+ return $this->helper('trustpilot')->getTotalScore();
132
+ }
133
+
134
+ }
app/code/local/Magmodules/Trustpilot/Block/Snippets.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Block_Snippets extends Mage_Core_Block_Template {
23
+
24
+ protected function _construct() {
25
+ if(Mage::getStoreConfig('trustpilot/general/enabled')) {
26
+ $this->setSnippetsEnabled(1);
27
+ } else {
28
+ $this->setSnippetsEnabled(0);
29
+ }
30
+
31
+ parent::_construct();
32
+ $this->setTemplate('magmodules/trustpilot/widget/richsnippets.phtml');
33
+ }
34
+
35
+ public function getSnippets() {
36
+ return $this->helper('trustpilot')->getTotalScore();
37
+ }
38
+
39
+ public function getHtmlStars($rating) {
40
+ return $this->helper('trustpilot')->getHtmlStars($rating);
41
+ }
42
+
43
+ public function getExternalLink() {
44
+ return $this->helper('trustpilot')->getExternalLink();
45
+ }
46
+
47
+ }
app/code/local/Magmodules/Trustpilot/Helper/Data.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Helper_Data extends Mage_Core_Helper_Abstract {
23
+
24
+ public function getTotalScore() {
25
+ $qty = 0; $rating = 0;
26
+ $shop_id = Mage::getStoreConfig('trustpilot/general/api_id');
27
+ $review_stats = Mage::getModel('trustpilot/stats')->load($shop_id, 'shop_id');
28
+ if($review_stats->getScore() > 0) {
29
+ $review_stats->setPercentage($review_stats->getScore());
30
+ $review_stats->setStarsQty(number_format(($review_stats->getScore() / 10), 2, '.', ''));
31
+ return $review_stats;
32
+ } else {
33
+ return false;
34
+ }
35
+ }
36
+
37
+ function getExternalLink() {
38
+ if(Mage::getStoreConfig('trustpilot/general/url')) {
39
+ return Mage::helper('trustpilot')->__('on') . ' <a href="' . Mage::getStoreConfig('trustpilot/general/url'). '" target="_blank">Trustpilot.nl</a>';
40
+ } else {
41
+ return false;
42
+ }
43
+ }
44
+
45
+ function getHtmlStars($rating)
46
+ {
47
+ $perc = $rating;
48
+ $html = '<div class="rating-box">';
49
+ $html .= ' <div class="rating" style="width:' . $perc . '%"></div>';
50
+ $html .= '</div>';
51
+ return $html;
52
+ }
53
+
54
+ }
app/code/local/Magmodules/Trustpilot/Model/Api.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Api extends Mage_Core_Model_Abstract {
23
+
24
+ public function processFeed($storeid = 0, $type) {
25
+ if($feed = $this->getFeed($storeid, $type)) {
26
+ $results = Mage::getModel('trustpilot/reviews')->processFeed($feed, $storeid, $type);
27
+ $results['stats'] = Mage::getModel('trustpilot/stats')->processFeed($feed, $storeid);
28
+ return $results;
29
+ } else {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ public function getFeed($storeid, $type = '') {
35
+ $api_id = Mage::getStoreConfig('trustpilot/general/api_id', $storeid);
36
+ $api_url = 'https://s.trustpilot.com/tpelements/' . $api_id . '/f.json';
37
+
38
+ if($api_id) {
39
+ $file = file_get_contents($api_url);
40
+ if($file) {
41
+ $json = json_decode($file);
42
+ return $json;
43
+ } else {
44
+ return false;
45
+ }
46
+ } else {
47
+ return false;
48
+ }
49
+ }
50
+
51
+ public function getStoreIds() {
52
+ $resource = Mage::getSingleton('core/resource');
53
+ $read = $resource->getConnection('core_read');
54
+ $query = "SELECT DISTINCT value, scope_id FROM " . $resource->getTableName('core/config_data') . " WHERE path LIKE 'trustpilot/general/api_id'";
55
+ $results = $read->fetchAll($query);
56
+ $storeids = array();
57
+
58
+ foreach($results as $result) {
59
+ if($result['value'] > 0) {
60
+ $storeids[] = $result['scope_id'];
61
+ }
62
+ }
63
+ return $storeids;
64
+ }
65
+
66
+ }
app/code/local/Magmodules/Trustpilot/Model/Log.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Log extends Mage_Core_Model_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/log');
27
+ }
28
+
29
+ public function addToLog($type, $storeid, $review = '', $inivation = '', $time, $crontype = '', $api_url = '', $orderid = '') {
30
+
31
+ if(Mage::getStoreConfig('trustpilot/log/enabled')) {
32
+
33
+ $api_id = Mage::getStoreConfig('trustpilot/general/api_id', $storeid);
34
+ $company = Mage::getStoreConfig('trustpilot/general/company', $storeid);
35
+ $review_updates = '';
36
+ $review_new = '';
37
+
38
+ if($review) {
39
+ $review_updates = $review['review_updates'];
40
+ $review_new = $review['review_new'];
41
+ }
42
+
43
+ $model = Mage::getModel('trustpilot/log');
44
+ $model->setType($type)
45
+ ->setShopId($api_id)
46
+ ->setCompany($company)
47
+ ->setReviewUpdate($review_updates)
48
+ ->setReviewNew($review_new)
49
+ ->setResponse($inivation)
50
+ ->setOrderId($orderid)
51
+ ->setCron($crontype)
52
+ ->setDate(now())
53
+ ->setTime($time)
54
+ ->setApiUrl($api_url)
55
+ ->save();
56
+ }
57
+
58
+ return;
59
+ }
60
+
61
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Log.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('trustpilot/log', 'id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Log/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/log');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Reviews.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Reviews extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('trustpilot/reviews', 'review_id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Reviews/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Reviews_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/reviews');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Stats.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Stats extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('trustpilot/stats', 'id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Trustpilot/Model/Mysql4/Stats/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Mysql4_Stats_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/stats');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Trustpilot/Model/Observer.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Observer {
23
+
24
+ public function processStats() {
25
+ $storeids = Mage::getModel('trustpilot/api')->getStoreIds();
26
+ foreach($storeids as $storeid) {
27
+ $enabled = Mage::getStoreConfig('trustpilot/general/enabled', $storeid);
28
+ $cron_enabled = Mage::getStoreConfig('trustpilot/reviews/cron', $storeid);
29
+ if($enabled && $cron_enabled) {
30
+ $crontype = 'stats';
31
+ $start_time = microtime(true);
32
+ $feed = Mage::getModel('trustpilot/api')->getFeed($storeid, $crontype);
33
+ $resuls = array();
34
+ $results['stats'] = Mage::getModel('trustpilot/stats')->processFeed($feed, $storeid);
35
+ $results['company'] = $feed->company;
36
+ $log = Mage::getModel('trustpilot/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
37
+ }
38
+ }
39
+ Mage::getModel('trustpilot/stats')->processOverall();
40
+ }
41
+
42
+ public function processReviews() {
43
+ $storeids = Mage::getModel('trustpilot/api')->getStoreIds();
44
+ foreach($storeids as $storeid) {
45
+ $enabled = Mage::getStoreConfig('trustpilot/general/enabled', $storeid);
46
+ $cron_enabled = Mage::getStoreConfig('trustpilot/reviews/cron', $storeid);
47
+ if($enabled && $cron_enabled) {
48
+ $crontype = 'reviews';
49
+ $start_time = microtime(true);
50
+ $feed = Mage::getModel('trustpilot/api')->getFeed($storeid, $crontype);
51
+ $results = Mage::getModel('trustpilot/reviews')->processFeed($feed, $storeid, $crontype);
52
+ $results['stats'] = Mage::getModel('trustpilot/stats')->processFeed($feed, $storeid, $type);
53
+ $log = Mage::getModel('trustpilot/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
54
+ }
55
+ }
56
+ }
57
+
58
+ public function processHistory() {
59
+ $storeids = Mage::getModel('trustpilot/api')->getStoreIds();
60
+ foreach($storeids as $storeid) {
61
+ $enabled = Mage::getStoreConfig('trustpilot/general/enabled', $storeid);
62
+ $cron_enabled = Mage::getStoreConfig('trustpilot/reviews/cron', $storeid);
63
+ if($enabled && $cron_enabled) {
64
+ $crontype = 'history';
65
+ $start_time = microtime(true); $storeid = 0;
66
+ $feed = Mage::getModel('trustpilot/api')->getFeed($storeid, $crontype);
67
+ $results = Mage::getModel('trustpilot/reviews')->processFeed($feed, $storeid, $crontype);
68
+ $results['stats'] = Mage::getModel('trustpilot/stats')->processFeed($feed, $storeid);
69
+ $log = Mage::getModel('trustpilot/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
70
+ }
71
+ }
72
+ }
73
+
74
+ public function cleanLog() {
75
+ $enabled = Mage::getStoreConfig('trustpilot/log/clean', 0);
76
+ $days = Mage::getStoreConfig('trustpilot/log/clean_days', 0);
77
+ if(($enabled) && ($days > 0)) {
78
+ $logmodel = Mage::getModel('trustpilot/log');
79
+ $deldate = date('Y-m-d', strtotime('-' . $days . ' days'));
80
+ $logs = $logmodel->getCollection()->addFieldToSelect('id')->addFieldToFilter('date', array('lteq' => $deldate));
81
+ foreach ($logs as $log) {
82
+ $logmodel->load($log->getId())->delete();
83
+ }
84
+ }
85
+ }
86
+
87
+ }
app/code/local/Magmodules/Trustpilot/Model/Reviews.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Reviews extends Mage_Core_Model_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/reviews');
27
+ }
28
+
29
+ public function loadbyTrustpilotId($trustpilot_id) {
30
+ $this->_getResource()->load($this, $trustpilot_id, 'trustpilot_id');
31
+ return $this;
32
+ }
33
+
34
+ public function processFeed($feed, $storeid = 0, $type) {
35
+
36
+ $updates = 0; $new = 0; $history = 0;
37
+ $api_id = Mage::getStoreConfig('trustpilot/general/api_id', $storeid);
38
+ $company = Mage::getStoreConfig('trustpilot/general/company', $storeid);
39
+
40
+
41
+ foreach($feed->Reviews as $review) {
42
+
43
+ // Get ID from URL
44
+ $id = explode("#", $review->Url);
45
+ $id = $id[1];
46
+
47
+ $trustpilot_id = (int)$id;
48
+ $title = $review->Title;
49
+ $content = $review->Content;
50
+ $score = $review->TrustScore->Score;
51
+ $stars = $review->TrustScore->Stars;
52
+ $human = $review->TrustScore->Human;
53
+ $stars_url_small = $review->TrustScore->StarsImageUrls->small;
54
+ $stars_url_medium = $review->TrustScore->StarsImageUrls->medium;
55
+ $stars_url_large = $review->TrustScore->StarsImageUrls->large;
56
+ $user_name = $review->User->Name;
57
+ $user_city = $review->User->City;
58
+ $user_locale = $review->User->Locale;
59
+ $user_review_count = $review->User->ReviewCount;
60
+ $user_is_verified = $review->User->IsVerified;
61
+ $user_image = $review->User->ImageUrls->i24;
62
+ $is_verified = $review->IsVerified;
63
+ $date_created = date('Y-m-d H:i:s', $review->Created->UnixTime);
64
+ $url = $review->Url;
65
+ $indatabase = $this->loadbyTrustpilotId($trustpilot_id);
66
+
67
+ if($indatabase->getReviewId()) {
68
+ if($type == 'history') {
69
+ $reviews = Mage::getModel('trustpilot/reviews');
70
+ $reviews->setReviewId($indatabase->getReviewId())
71
+ ->setShopId($api_id)
72
+ ->setCompany($company)
73
+ ->setTrustpilotId($trustpilot_id)
74
+ ->setTitle($title)
75
+ ->setContent($content)
76
+ ->setScore($score)
77
+ ->setStars($stars)
78
+ ->setHuman($human)
79
+ ->setStarsUrlSmall($stars_url_small)
80
+ ->setStarsUrlMedium($stars_url_medium)
81
+ ->setStarsUrlLarge($stars_url_large)
82
+ ->setUserName($user_name)
83
+ ->setUserCity($user_city)
84
+ ->setUserLocale($user_locale)
85
+ ->setUserReviewCount($user_review_count)
86
+ ->setUserIsVerified($user_is_verified)
87
+ ->setUserImage($user_image)
88
+ ->setIsVerified($is_verified)
89
+ ->setUrl($url)
90
+ ->setDateCreated($date_created)
91
+ ->save();
92
+ $updates++;
93
+ } else {
94
+ break;
95
+ }
96
+ } else {
97
+ $reviews = Mage::getModel('trustpilot/reviews');
98
+ $reviews->setShopId($api_id)
99
+ ->setCompany($company)
100
+ ->setTrustpilotId($trustpilot_id)
101
+ ->setTitle($title)
102
+ ->setContent($content)
103
+ ->setScore($score)
104
+ ->setStars($stars)
105
+ ->setHuman($human)
106
+ ->setStarsUrlSmall($stars_url_small)
107
+ ->setStarsUrlMedium($stars_url_medium)
108
+ ->setStarsUrlLarge($stars_url_large)
109
+ ->setUserName($user_name)
110
+ ->setUserCity($user_city)
111
+ ->setUserLocale($user_locale)
112
+ ->setUserReviewCount($user_review_count)
113
+ ->setUserIsVerified($user_is_verified)
114
+ ->setUserImage($user_image)
115
+ ->setIsVerified($is_verified)
116
+ ->setUrl($url)
117
+ ->setDateCreated($date_created)
118
+ ->save();
119
+ $new++;
120
+ }
121
+ }
122
+
123
+ $config = new Mage_Core_Model_Config();
124
+ $config->saveConfig('trustpilot/reviews/lastrun', now(), 'default', $storeid);
125
+ $result = array();
126
+ $result['review_updates'] = $updates;
127
+ $result['review_new'] = $new;
128
+ $result['company'] = $company;
129
+ return $result;
130
+ }
131
+
132
+ }
app/code/local/Magmodules/Trustpilot/Model/Stats.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_Stats extends Mage_Core_Model_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('trustpilot/stats');
27
+ }
28
+
29
+ public function processFeed($feed, $storeid = 0) {
30
+ $shop_id = Mage::getStoreConfig('trustpilot/general/api_id', $storeid);
31
+ $company = $feed->DomainName;
32
+
33
+ if($storeid == 0) {
34
+ $config = new Mage_Core_Model_Config();
35
+ $config->saveConfig('trustpilot/general/url', $feed->ReviewPageUrl, 'default', $storeid);
36
+ $config->saveConfig('trustpilot/general/company', $company, 'default', $storeid);
37
+ } else {
38
+ $config = new Mage_Core_Model_Config();
39
+ $config->saveConfig('trustpilot/general/url', $feed->ReviewPageUrl, 'stores', $storeid);
40
+ $config->saveConfig('trustpilot/general/company', $company, 'stores', $storeid);
41
+ }
42
+
43
+ if($feed->ReviewCount->Total > 0) {
44
+ $score = floatval($feed->TrustScore->Score);
45
+ $scoremax = '100';
46
+ $votes = $feed->ReviewCount->Total;
47
+ $human = $feed->TrustScore->Human;
48
+ $stars_url = $feed->TrustScore->StarsImageUrls->large;
49
+
50
+ // Check for update or save
51
+ if($indatabase = $this->loadbyShopId($shop_id)) {
52
+ $id = $indatabase->getId();
53
+ } else {
54
+ $id = '';
55
+ }
56
+
57
+ // Save Review Stats
58
+ $model = Mage::getModel('trustpilot/stats');
59
+ $model->setId($id)
60
+ ->setShopId($shop_id)
61
+ ->setCompany($company)
62
+ ->setScore($score)
63
+ ->setScoremax($scoremax)
64
+ ->setVotes($votes)
65
+ ->setHuman($human)
66
+ ->setStarsUrl($stars_url)
67
+ ->save();
68
+ return true;
69
+ } else {
70
+ return false;
71
+ }
72
+ }
73
+
74
+ public function processOverall() {
75
+ $stats = Mage::getModel('trustpilot/stats')->getCollection();
76
+ $stats->addFieldToFilter('shop_id', array('neq' => '0'));
77
+
78
+ $score = '';
79
+ $scoremax = '';
80
+ $votes= '';
81
+ $i = 0;
82
+
83
+ foreach($stats as $stat) {
84
+ $score = ($score + $stat->getScore());
85
+ $scoremax = ($scoremax + $stat->getScoremax());
86
+ $votes = ($votes + $stat->getVotes());
87
+ $i++;
88
+ }
89
+
90
+ $score = ($score / $i);
91
+ $scoremax = ($scoremax / $i);
92
+ $company = 'Overall';
93
+
94
+ if($indatabase = $this->loadbyShopId(0)) {
95
+ $id = $indatabase->getId();
96
+ } else {
97
+ $id = '';
98
+ }
99
+
100
+ $model = Mage::getModel('trustpilot/stats')
101
+ ->setId($id)
102
+ ->setShopId(0)
103
+ ->setCompany($company)
104
+ ->setScore($score)
105
+ ->setScoremax($scoremax)
106
+ ->setVotes($votes)
107
+ ->save();
108
+ }
109
+
110
+ public function loadbyShopId($shop_id) {
111
+ $this->_getResource()->load($this, $shop_id, 'shop_id');
112
+ return $this;
113
+ }
114
+
115
+ }
app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Cronfrequency.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_System_Config_Source_Cronfrequency {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ '*/15 * * * *' => Mage::helper('trustpilot')->__('Every 15 minutes'),
27
+ '0 * * * *' => Mage::helper('trustpilot')->__('Every Hour'),
28
+ '0 */2 * * *' => Mage::helper('trustpilot')->__('Every other Hour'),
29
+ '0 8,20 * * *' => Mage::helper('trustpilot')->__('Twice a Day'),
30
+ '0 02 * * *' => Mage::helper('trustpilot')->__('Once a Day'),
31
+ '0 02 0 * *' => Mage::helper('trustpilot')->__('Once a Week'),
32
+ );
33
+ }
34
+
35
+ }
app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Orderstatus.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_System_Config_Source_Orderstatus {
23
+
24
+ public function toOptionArray() {
25
+ $storeModel = Mage::getSingleton('adminhtml/system_store');
26
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
27
+ $options = array();
28
+
29
+ $this->_options = array(array('value' => 0, 'label' => Mage::helper('trustpilot') -> __('-- none')));
30
+
31
+ foreach($statuses as $k=>$v) {
32
+ $options[] = array('label' => $v, 'value' => $k);
33
+ }
34
+
35
+ $this->_options = array_merge($this->_options, $options);
36
+ return $this->_options;
37
+ }
38
+
39
+ }
app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Position.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_System_Config_Source_Position {
23
+
24
+ public function toOptionArray() {
25
+ $position = array();
26
+ $position[] = array('value'=>'left', 'label'=> Mage::helper('trustpilot')->__('Left'));
27
+ $position[] = array('value'=>'right', 'label'=> Mage::helper('trustpilot')->__('Right'));
28
+ return $position;
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Sidebarlink.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_System_Config_Source_Sidebarlink {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ '' => Mage::helper('trustpilot')->__('None'),
27
+ 'external' => Mage::helper('trustpilot')->__('External (Trustpilot.nl)'),
28
+ 'internal' => Mage::helper('trustpilot')->__('Internal (/trustpilot)'),
29
+ );
30
+ }
31
+
32
+ }
app/code/local/Magmodules/Trustpilot/Model/System/Config/Source/Sidebarstyle.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Model_System_Config_Source_Sidebarstyle {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ 'magento' => Mage::helper('trustpilot')->__('Magento Style'),
27
+ 'trustpilot' => Mage::helper('trustpilot')->__('Trustpilot Style'),
28
+ );
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Trustpilot/controllers/Adminhtml/TrustpilotlogController.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Adminhtml_TrustpilotlogController extends Mage_Adminhtml_Controller_Action {
23
+
24
+ protected function _initAction() {
25
+ $this->loadLayout()->_setActiveMenu('trustpilot/trustpilotreviews')->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
26
+ return $this;
27
+ }
28
+
29
+ public function indexAction() {
30
+ $this->_initAction()->renderLayout();
31
+ }
32
+
33
+ public function massDeleteAction() {
34
+ $LogIds = $this->getRequest()->getParam('logids');
35
+ if(!is_array($LogIds)) {
36
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Please select item(s)'));
37
+ } else {
38
+ try {
39
+ foreach ($LogIds as $id) {
40
+ $log = Mage::getModel('trustpilot/log')->load($id)->delete();
41
+ }
42
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %d log record(s) deleted.', count($LogIds)));
43
+ } catch (Exception $e) {
44
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
45
+ }
46
+ }
47
+ $this->_redirect('*/*/index');
48
+ }
49
+
50
+ public function cleanAction() {
51
+ $enabled = Mage::getStoreConfig('trustpilot/log/clean');
52
+ $days = Mage::getStoreConfig('trustpilot/log/clean_days');
53
+ $i = 0;
54
+ if(($enabled) && ($days > 0)) {
55
+ $logmodel = Mage::getModel('trustpilot/log');
56
+ $deldate = date('Y-m-d', strtotime('-' . $days . ' days'));
57
+ $logs = $logmodel->getCollection()->addFieldToSelect('id')->addFieldToFilter('date', array('lteq' => $deldate));
58
+ foreach ($logs as $log) {
59
+ $logmodel->load($log->getId())->delete();
60
+ $i++;
61
+ }
62
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %s log record(s) deleted.', $i));
63
+ }
64
+ $this->_redirect('*/*/index');
65
+ }
66
+
67
+ }
app/code/local/Magmodules/Trustpilot/controllers/Adminhtml/TrustpilotreviewsController.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_Adminhtml_TrustpilotreviewsController extends Mage_Adminhtml_Controller_Action {
23
+
24
+ protected function _initAction() {
25
+ $this->loadLayout()->_setActiveMenu('trustpilot/trustpilotreviews')->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
26
+ return $this;
27
+ }
28
+
29
+ public function indexAction() {
30
+ $this->_initAction()->renderLayout();
31
+ }
32
+
33
+ public function processAction() {
34
+ $storeids = Mage::getModel('trustpilot/api')->getStoreIds();
35
+ $start_time = microtime(true);
36
+ foreach($storeids as $storeid) {
37
+ $msg = '';
38
+ $api_id = Mage::getStoreConfig('trustpilot/general/api_id', $storeid);
39
+ $result = Mage::getModel('trustpilot/api')->processFeed($storeid, 'history');
40
+ $log = Mage::getModel('trustpilot/log')->addToLog('reviews', $storeid, $result, '', (microtime(true) - $start_time), '', '');
41
+
42
+ if(($result['review_new'] > 0) || ($result['review_updates'] > 0) || ($result['stats'] == true)) {
43
+ $msg = Mage::helper('trustpilot')->__('Webwinkel ID %s:', $api_id) . ' ';
44
+ $msg .= Mage::helper('trustpilot')->__('%s new review(s)', $result['review_new']) . ', ';
45
+ $msg .= Mage::helper('trustpilot')->__('%s review(s) updated', $result['review_updates']) . ' & ';
46
+ $msg .= Mage::helper('trustpilot')->__('and total score updated.');
47
+ }
48
+
49
+ if($msg) {
50
+ Mage::getSingleton('adminhtml/session')->addSuccess($msg);
51
+ } else {
52
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Webwinkel ID %s: no updates found, feed is empty or not foud!', $api_id));
53
+ }
54
+ }
55
+ $this->_redirect('adminhtml/system_config/edit/section/trustpilot');
56
+ }
57
+
58
+ public function testapiAction() {
59
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('TODO: repsonse code van de API', $xml));
60
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('TODO: repsonse code van de API', $xml));
61
+ $this->_redirect('adminhtml/system_config/edit/section/trustpilot');
62
+ }
63
+
64
+ public function massDisableAction() {
65
+ $reviewIds = $this->getRequest()->getParam('reviewids');
66
+ if(!is_array($reviewIds)) {
67
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Please select item(s)'));
68
+ } else {
69
+ try {
70
+ foreach ($reviewIds as $review_id) {
71
+ $reviews = Mage::getModel('trustpilot/reviews')->load($review_id);
72
+ $reviews->setStatus(0)->save();
73
+ }
74
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %d review(s) were disabled.', count($reviewIds)));
75
+ } catch (Exception $e) {
76
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
77
+ }
78
+ }
79
+ $this->_redirect('*/*/index');
80
+ }
81
+
82
+ public function massEnableAction() {
83
+ $reviewIds = $this->getRequest()->getParam('reviewids');
84
+ if(!is_array($reviewIds)) {
85
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Please select item(s)'));
86
+ } else {
87
+ try {
88
+ foreach ($reviewIds as $review_id) {
89
+ $reviews = Mage::getModel('trustpilot/reviews')->load($review_id);
90
+ $reviews->setStatus(1)->save();
91
+ }
92
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %d review(s) were enabled.', count($reviewIds)));
93
+ } catch (Exception $e) {
94
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
95
+ }
96
+ }
97
+ $this->_redirect('*/*/index');
98
+ }
99
+
100
+ public function massEnableSidebarAction() {
101
+ $reviewIds = $this->getRequest()->getParam('reviewids');
102
+ if(!is_array($reviewIds)) {
103
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Please select item(s)'));
104
+ } else {
105
+ try {
106
+ foreach ($reviewIds as $review_id) {
107
+ $reviews = Mage::getModel('trustpilot/reviews')->load($review_id);
108
+ $reviews->setSidebar(1)->save();
109
+ }
110
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %d review(s) were added to the sidebar.', count($reviewIds)));
111
+ } catch (Exception $e) {
112
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
113
+ }
114
+ }
115
+ $this->_redirect('*/*/index');
116
+ }
117
+
118
+ public function massDisableSidebarAction() {
119
+ $reviewIds = $this->getRequest()->getParam('reviewids');
120
+ if(!is_array($reviewIds)) {
121
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('trustpilot')->__('Please select item(s)'));
122
+ } else {
123
+ try {
124
+ foreach ($reviewIds as $review_id) {
125
+ $reviews = Mage::getModel('trustpilot/reviews')->load($review_id);
126
+ $reviews->setSidebar(0)->save();
127
+ }
128
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Total of %d review(s) were removed from the sidebar.', count($reviewIds)));
129
+ } catch (Exception $e) {
130
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
131
+ }
132
+ }
133
+ $this->_redirect('*/*/index');
134
+ }
135
+
136
+ public function truncateAction() {
137
+ $i = 0;
138
+ $collection = Mage::getModel('trustpilot/reviews')->getCollection();
139
+ foreach ($collection as $item) {
140
+ $item->delete();
141
+ $i++;
142
+ }
143
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('trustpilot')->__('Succefully deleted all %s saved review(s).', $i));
144
+ $this->_redirect('*/*/index');
145
+ }
146
+
147
+ }
app/code/local/Magmodules/Trustpilot/controllers/IndexController.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Trustpilot_IndexController extends Mage_Core_Controller_Front_Action {
23
+
24
+ public function indexAction() {
25
+
26
+ $enabled = Mage::getStoreConfig('trustpilot/general/enabled');
27
+ $overview = Mage::getStoreConfig('trustpilot/overview/enabled');
28
+
29
+ if($enabled && $overview) {
30
+ $this->loadLayout();
31
+ $head = $this->getLayout()->getBlock('head');
32
+
33
+ if($title = Mage::getStoreConfig('trustpilot/overview/meta_title')):
34
+ $head->setTitle($title);
35
+ endif;
36
+
37
+ if($description = Mage::getStoreConfig('trustpilot/overview/meta_description')):
38
+ $head->setDescription($description);
39
+ endif;
40
+
41
+ if($keywords = Mage::getStoreConfig('trustpilot/overview/meta_keywords')):
42
+ $head->setKeywords($keywords);
43
+ endif;
44
+
45
+ $this->renderLayout();
46
+ } else {
47
+ $this->_redirect('/');
48
+ }
49
+ }
50
+
51
+ }
app/code/local/Magmodules/Trustpilot/etc/adminhtml.xml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu
5
+ * http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Trustpilot
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <menu>
26
+ <shopreview module="trustpilot">
27
+ <title>Reviews</title>
28
+ <sort_order>71</sort_order>
29
+ <children>
30
+ <trustpilot module="trustpilot">
31
+ <title>Trustpilot</title>
32
+ <sort_order>12</sort_order>
33
+ <children>
34
+ <trustpilot_reviews module="trustpilot">
35
+ <title>Manage Reviews</title>
36
+ <sort_order>100</sort_order>
37
+ <action>adminhtml/trustpilotreviews/</action>
38
+ </trustpilot_reviews>
39
+ <trustpilot_log module="trustpilot">
40
+ <title>Manage Log</title>
41
+ <sort_order>110</sort_order>
42
+ <action>adminhtml/trustpilotlog/</action>
43
+ </trustpilot_log>
44
+ <trustpilot_config module="trustpilot">
45
+ <title>Trustpilot Config</title>
46
+ <sort_order>120</sort_order>
47
+ <action>adminhtml/system_config/edit/section/trustpilot</action>
48
+ </trustpilot_config>
49
+ </children>
50
+ </trustpilot>
51
+ </children>
52
+ </shopreview>
53
+ </menu>
54
+ <acl>
55
+ <resources>
56
+ <all>
57
+ <title>Allow Everything</title>
58
+ </all>
59
+ <admin>
60
+ <children>
61
+ <system>
62
+ <children>
63
+ <config>
64
+ <children>
65
+ <trustpilot translate="title" module="trustpilot">
66
+ <title>Trustpilot Permission Setting</title>
67
+ </trustpilot>
68
+ </children>
69
+ </config>
70
+ </children>
71
+ </system>
72
+ <trustpilot module="trustpilot">
73
+ <title>Trustpilot</title>
74
+ <sort_order>60</sort_order>
75
+ <children>
76
+ <trustpilot_reviews module="trustpilot">
77
+ <title>Reviews</title>
78
+ <sort_order>100</sort_order>
79
+ <action>adminhtml/trustpilotreviews/</action>
80
+ </trustpilot_reviews>
81
+ <trustpilot_log module="trustpilot">
82
+ <title>Log</title>
83
+ <sort_order>110</sort_order>
84
+ <action>adminhtml/trustpilotlog/</action>
85
+ </trustpilot_log>
86
+ </children>
87
+ </trustpilot>
88
+ </children>
89
+ </admin>
90
+ </resources>
91
+ </acl>
92
+ </config>
app/code/local/Magmodules/Trustpilot/etc/config.xml ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ <?php
4
+ /**
5
+ * Magmodules.eu - http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Trustpilot
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Magmodules_Trustpilot>
27
+ <version>1.0.0</version>
28
+ </Magmodules_Trustpilot>
29
+ </modules>
30
+ <global>
31
+ <models>
32
+ <trustpilot>
33
+ <class>Magmodules_Trustpilot_Model</class>
34
+ <resourceModel>trustpilot_mysql4</resourceModel>
35
+ </trustpilot>
36
+ <trustpilot_mysql4>
37
+ <class>Magmodules_Trustpilot_Model_Mysql4</class>
38
+ <entities>
39
+ <reviews>
40
+ <table>trustpilot_reviews</table>
41
+ </reviews>
42
+ <stats>
43
+ <table>trustpilot_stats</table>
44
+ </stats>
45
+ <log>
46
+ <table>trustpilot_log</table>
47
+ </log>
48
+ </entities>
49
+ </trustpilot_mysql4>
50
+ </models>
51
+ <resources>
52
+ <trustpilot_setup>
53
+ <setup>
54
+ <module>Magmodules_Trustpilot</module>
55
+ </setup>
56
+ <connection>
57
+ <use>core_setup</use>
58
+ </connection>
59
+ </trustpilot_setup>
60
+ <trustpilot_write>
61
+ <connection>
62
+ <use>core_write</use>
63
+ </connection>
64
+ </trustpilot_write>
65
+ <trustpilot_read>
66
+ <connection>
67
+ <use>core_read</use>
68
+ </connection>
69
+ </trustpilot_read>
70
+ </resources>
71
+ <helpers>
72
+ <trustpilot>
73
+ <class>Magmodules_Trustpilot_Helper</class>
74
+ </trustpilot>
75
+ </helpers>
76
+ <blocks>
77
+ <trustpilot>
78
+ <class>Magmodules_Trustpilot_Block</class>
79
+ </trustpilot>
80
+ </blocks>
81
+ </global>
82
+ <frontend>
83
+ <routers>
84
+ <trustpilot>
85
+ <use>standard</use>
86
+ <args>
87
+ <module>Magmodules_Trustpilot</module>
88
+ <frontName>trustpilot</frontName>
89
+ </args>
90
+ </trustpilot>
91
+ </routers>
92
+ <layout>
93
+ <updates>
94
+ <trustpilot>
95
+ <file>magmodules_trustpilot.xml</file>
96
+ </trustpilot>
97
+ </updates>
98
+ </layout>
99
+ <translate>
100
+ <modules>
101
+ <magmodules_trustpilot>
102
+ <files>
103
+ <default>Magmodules_Trustpilot.csv</default>
104
+ </files>
105
+ </magmodules_trustpilot>
106
+ </modules>
107
+ </translate>
108
+ </frontend>
109
+ <adminhtml>
110
+ <layout>
111
+ <updates>
112
+ <magmodules_trustpilot>
113
+ <file>magmodules_trustpilot.xml</file>
114
+ </magmodules_trustpilot>
115
+ </updates>
116
+ </layout>
117
+ <translate>
118
+ <modules>
119
+ <magmodules_trustpilot>
120
+ <files>
121
+ <default>Magmodules_Trustpilot.csv</default>
122
+ </files>
123
+ </magmodules_trustpilot>
124
+ </modules>
125
+ </translate>
126
+ </adminhtml>
127
+ <admin>
128
+ <routers>
129
+ <adminhtml>
130
+ <args>
131
+ <modules>
132
+ <magmodules_trustpilot after="Mage_Adminhtml">Magmodules_Trustpilot_Adminhtml</magmodules_trustpilot>
133
+ </modules>
134
+ </args>
135
+ </adminhtml>
136
+ </routers>
137
+ </admin>
138
+ <crontab>
139
+ <jobs>
140
+ <magmodules_trustpilot_stats>
141
+ <schedule><config_path>trustpilot/reviews/cron_stats</config_path></schedule>
142
+ <run><model>trustpilot/observer::processStats</model></run>
143
+ </magmodules_trustpilot_stats>
144
+ <magmodules_trustpilot_reviews>
145
+ <schedule><config_path>trustpilot/reviews/cron_reviews</config_path></schedule>
146
+ <run><model>trustpilot/observer::processReviews</model></run>
147
+ </magmodules_trustpilot_reviews>
148
+ <magmodules_trustpilot_cleanlog>
149
+ <schedule><cron_expr>0 02 * * *</cron_expr></schedule>
150
+ <run><model>trustpilot/observer::cleanLog</model></run>
151
+ </magmodules_trustpilot_cleanlog>
152
+ </jobs>
153
+ </crontab>
154
+ <default>
155
+ <trustpilot>
156
+ <general>
157
+ <enabled>0</enabled>
158
+ </general>
159
+ <reviews>
160
+ <cron>0</cron>
161
+ <cron_stats>*/15 * * * *</cron_stats>
162
+ <cron_reviews>0 */2 * * *</cron_reviews>
163
+ </reviews>
164
+ <sidebar>
165
+ <left>0</left>
166
+ <left_qty>3</left_qty>
167
+ <left_lenght>150</left_lenght>
168
+ <left_link>external</left_link>
169
+ <right>0</right>
170
+ <right_qty>3</right_qty>
171
+ <right_lenght>150</right_lenght>
172
+ <right_link>external</right_link>
173
+ </sidebar>
174
+ <overview>
175
+ <enabled>1</enabled>
176
+ <enable_paging>1</enable_paging>
177
+ <paging_settings>10,20,30</paging_settings>
178
+ <meta_title>Trustpilot Reviews</meta_title>
179
+ <meta_description>Trustpilot Reviews overview page</meta_description>
180
+ <meta_keywords>reviews, trustpilot</meta_keywords>
181
+ </overview>
182
+ <frontend>
183
+ <enabled>0</enabled>
184
+ <tooltip>0</tooltip>
185
+ <sidebar_position>left</sidebar_position>
186
+ <sidebar_height>120</sidebar_height>
187
+ </frontend>
188
+ <log>
189
+ <enabled>1</enabled>
190
+ <clean>1</clean>
191
+ <clean_days>14</clean_days>
192
+ </log>
193
+ </trustpilot>
194
+ </default>
195
+ </config>
app/code/local/Magmodules/Trustpilot/etc/system.xml ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu
5
+ * http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Trustpilot
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <tabs>
26
+ <magmodules translate="label" module="trustpilot">
27
+ <label>Magmodules</label>
28
+ <sort_order>200</sort_order>
29
+ </magmodules>
30
+ </tabs>
31
+ <sections>
32
+ <trustpilot translate="label" module="trustpilot">
33
+ <label>Trustpilot</label>
34
+ <tab>magmodules</tab>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>40</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <groups>
41
+ <info>
42
+ <frontend_model>trustpilot/adminhtml_widget_info_info</frontend_model>
43
+ <sort_order>1</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </info>
48
+ <general translate="label" module="trustpilot">
49
+ <label>General configuration</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>2</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <expanded>1</expanded>
56
+ <comment>
57
+ <![CDATA[
58
+ <script>
59
+ Event.observe(window, 'load', function() {
60
+ if ($('trustpilot_reviews_lastrun')) {
61
+ $('trustpilot_reviews_lastrun').style.backgroundColor='#f0f0f0';
62
+ $('trustpilot_reviews_lastrun').disable();
63
+ }
64
+ if ($('trustpilot_general_url')) {
65
+ $('trustpilot_general_url').style.backgroundColor='#f0f0f0';
66
+ $('trustpilot_general_url').disable();
67
+ }
68
+ if ($('trustpilot_general_company')) {
69
+ $('trustpilot_general_company').style.backgroundColor='#f0f0f0';
70
+ $('trustpilot_general_company').disable();
71
+ }
72
+ });
73
+ </script>
74
+ ]]>
75
+ </comment>
76
+ <fields>
77
+ <enabled translate="label">
78
+ <label>Enabled</label>
79
+ <frontend_type>select</frontend_type>
80
+ <source_model>adminhtml/system_config_source_yesno</source_model>
81
+ <sort_order>1</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ </enabled>
86
+ <heading_api translate="label">
87
+ <label>API CREDENTIALS</label>
88
+ <frontend_model>trustpilot/adminhtml_widget_form_heading</frontend_model>
89
+ <sort_order>2</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>0</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </heading_api>
94
+ <api_id translate="label">
95
+ <label>Trustpilot ID</label>
96
+ <frontend_type>text</frontend_type>
97
+ <sort_order>3</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>0</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <comment>You ID can be found on http://b2b.trustpilot.com/Modules/Plugins. Goto Integrations -> JSON Feed. The Trustpilot ID is the number within the feed url, e.g. http://s.trustpilot.com/tpelements/917278/f.json.gz would give ID: 917278</comment>
102
+ </api_id>
103
+ <company translate="label">
104
+ <label>Company Url</label>
105
+ <frontend_type>text</frontend_type>
106
+ <sort_order>4</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>0</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ </company>
111
+ <url translate="label">
112
+ <label>Trustpilot Url</label>
113
+ <frontend_type>text</frontend_type>
114
+ <sort_order>5</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>0</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ </url>
119
+ </fields>
120
+ </general>
121
+ <reviews translate="label" module="trustpilot">
122
+ <label>Trustpilot Import Reviews</label>
123
+ <frontend_type>text</frontend_type>
124
+ <sort_order>3</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>1</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ <expanded>1</expanded>
129
+ <fields>
130
+ <cron translate="label">
131
+ <label>Use Cronjob</label>
132
+ <frontend_type>select</frontend_type>
133
+ <source_model>adminhtml/system_config_source_yesno</source_model>
134
+ <sort_order>1</sort_order>
135
+ <show_in_default>1</show_in_default>
136
+ <show_in_website>1</show_in_website>
137
+ <show_in_store>1</show_in_store>
138
+ </cron>
139
+ <cron_stats translate="label">
140
+ <label>Update Summary</label>
141
+ <frontend_type>select</frontend_type>
142
+ <source_model>trustpilot/system_config_source_cronfrequency</source_model>
143
+ <sort_order>2</sort_order>
144
+ <show_in_default>1</show_in_default>
145
+ <show_in_website>1</show_in_website>
146
+ <show_in_store>1</show_in_store>
147
+ <depends><cron>1</cron></depends>
148
+ </cron_stats>
149
+ <cron_reviews translate="label">
150
+ <label>Update Reviews</label>
151
+ <frontend_type>select</frontend_type>
152
+ <source_model>trustpilot/system_config_source_cronfrequency</source_model>
153
+ <sort_order>3</sort_order>
154
+ <show_in_default>1</show_in_default>
155
+ <show_in_website>1</show_in_website>
156
+ <show_in_store>1</show_in_store>
157
+ <depends><cron>1</cron></depends>
158
+ </cron_reviews>
159
+ <lastrun translate="label">
160
+ <label>Last Update</label>
161
+ <frontend_type>text</frontend_type>
162
+ <sort_order>100</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>1</show_in_website>
165
+ <show_in_store>1</show_in_store>
166
+ </lastrun>
167
+ <process translate="label">
168
+ <label>Process Manually</label>
169
+ <frontend_type>button</frontend_type>
170
+ <frontend_model>trustpilot/adminhtml_widget_buttons_process</frontend_model>
171
+ <sort_order>101</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>1</show_in_store>
175
+ </process>
176
+ </fields>
177
+ </reviews>
178
+ <sidebar translate="label">
179
+ <label>Trustpilot Reviews Sidebar</label>
180
+ <frontend_type>text</frontend_type>
181
+ <sort_order>4</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ <expanded>1</expanded>
186
+ <fields>
187
+ <left_heading translate="label">
188
+ <label>Left Sidebar</label>
189
+ <frontend_model>trustpilot/adminhtml_widget_form_heading</frontend_model>
190
+ <sort_order>50</sort_order>
191
+ <show_in_default>1</show_in_default>
192
+ <show_in_website>1</show_in_website>
193
+ <show_in_store>1</show_in_store>
194
+ </left_heading>
195
+ <left translate="label">
196
+ <label>Enabled</label>
197
+ <frontend_type>select</frontend_type>
198
+ <source_model>adminhtml/system_config_source_yesno</source_model>
199
+ <sort_order>51</sort_order>
200
+ <show_in_default>1</show_in_default>
201
+ <show_in_website>1</show_in_website>
202
+ <show_in_store>1</show_in_store>
203
+ </left>
204
+ <left_qty translate="label">
205
+ <label>Number of Reviews</label>
206
+ <validate>validate-number</validate>
207
+ <frontend_type>text</frontend_type>
208
+ <sort_order>52</sort_order>
209
+ <show_in_default>1</show_in_default>
210
+ <show_in_website>1</show_in_website>
211
+ <show_in_store>1</show_in_store>
212
+ <depends><left>1</left></depends>
213
+ </left_qty>
214
+ <left_lenght translate="label">
215
+ <label>Length of Reviews</label>
216
+ <validate>validate-number</validate>
217
+ <frontend_type>text</frontend_type>
218
+ <sort_order>53</sort_order>
219
+ <show_in_default>1</show_in_default>
220
+ <show_in_website>1</show_in_website>
221
+ <show_in_store>1</show_in_store>
222
+ <depends><left>1</left></depends>
223
+ </left_lenght>
224
+ <left_link translate="label">
225
+ <label>Link to</label>
226
+ <frontend_type>select</frontend_type>
227
+ <source_model>trustpilot/system_config_source_sidebarlink</source_model>
228
+ <sort_order>55</sort_order>
229
+ <show_in_default>1</show_in_default>
230
+ <show_in_website>1</show_in_website>
231
+ <show_in_store>1</show_in_store>
232
+ <depends><left>1</left></depends>
233
+ </left_link>
234
+ <left_style translate="label">
235
+ <label>Sidebar Style</label>
236
+ <frontend_type>select</frontend_type>
237
+ <source_model>trustpilot/system_config_source_sidebarstyle</source_model>
238
+ <sort_order>56</sort_order>
239
+ <show_in_default>1</show_in_default>
240
+ <show_in_website>1</show_in_website>
241
+ <show_in_store>1</show_in_store>
242
+ <depends><left>1</left></depends>
243
+ </left_style>
244
+ <left_snippets translate="label">
245
+ <label>Add Rich Snippets</label>
246
+ <frontend_type>select</frontend_type>
247
+ <source_model>adminhtml/system_config_source_yesno</source_model>
248
+ <sort_order>57</sort_order>
249
+ <show_in_default>1</show_in_default>
250
+ <show_in_website>1</show_in_website>
251
+ <show_in_store>1</show_in_store>
252
+ <depends><left>1</left></depends>
253
+ <comment>You can only activate the Rich Snippets when this block is shown on your Homepage only</comment>
254
+ </left_snippets>
255
+ <right_heading translate="label">
256
+ <label>Right Sidebar</label>
257
+ <frontend_model>trustpilot/adminhtml_widget_form_heading</frontend_model>
258
+ <sort_order>60</sort_order>
259
+ <show_in_default>1</show_in_default>
260
+ <show_in_website>1</show_in_website>
261
+ <show_in_store>1</show_in_store>
262
+ </right_heading>
263
+ <right translate="label">
264
+ <label>Enabled</label>
265
+ <frontend_type>select</frontend_type>
266
+ <source_model>adminhtml/system_config_source_yesno</source_model>
267
+ <sort_order>61</sort_order>
268
+ <show_in_default>1</show_in_default>
269
+ <show_in_website>1</show_in_website>
270
+ <show_in_store>1</show_in_store>
271
+ </right>
272
+ <right_qty translate="label">
273
+ <label>Number of Reviews</label>
274
+ <validate>validate-number</validate>
275
+ <frontend_type>text</frontend_type>
276
+ <sort_order>62</sort_order>
277
+ <show_in_default>1</show_in_default>
278
+ <show_in_website>1</show_in_website>
279
+ <show_in_store>1</show_in_store>
280
+ <depends><right>1</right></depends>
281
+ </right_qty>
282
+ <right_lenght translate="label">
283
+ <label>Length of Reviews</label>
284
+ <validate>validate-number</validate>
285
+ <frontend_type>text</frontend_type>
286
+ <sort_order>63</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ <depends><right>1</right></depends>
291
+ </right_lenght>
292
+ <right_link>
293
+ <label>Link to</label>
294
+ <frontend_type>select</frontend_type>
295
+ <source_model>trustpilot/system_config_source_sidebarlink</source_model>
296
+ <sort_order>64</sort_order>
297
+ <show_in_default>1</show_in_default>
298
+ <show_in_website>1</show_in_website>
299
+ <show_in_store>1</show_in_store>
300
+ <depends><right>1</right></depends>
301
+ </right_link>
302
+ <right_style translate="label">
303
+ <label>Sidebar Style</label>
304
+ <frontend_type>select</frontend_type>
305
+ <source_model>trustpilot/system_config_source_sidebarstyle</source_model>
306
+ <sort_order>65</sort_order>
307
+ <show_in_default>1</show_in_default>
308
+ <show_in_website>1</show_in_website>
309
+ <show_in_store>1</show_in_store>
310
+ <depends><right>1</right></depends>
311
+ </right_style>
312
+ <right_snippets translate="label">
313
+ <label>Add to Sidebar Homepage</label>
314
+ <frontend_type>select</frontend_type>
315
+ <source_model>adminhtml/system_config_source_yesno</source_model>
316
+ <sort_order>66</sort_order>
317
+ <show_in_default>1</show_in_default>
318
+ <show_in_website>1</show_in_website>
319
+ <show_in_store>1</show_in_store>
320
+ <depends><right>1</right></depends>
321
+ <comment>You can only activate the Rich Snippets when this block is shown on your Homepage only</comment>
322
+ </right_snippets>
323
+ </fields>
324
+ </sidebar>
325
+ <overview translate="label">
326
+ <label>Trustpilot Overview Page</label>
327
+ <frontend_type>text</frontend_type>
328
+ <sort_order>6</sort_order>
329
+ <show_in_default>1</show_in_default>
330
+ <show_in_website>1</show_in_website>
331
+ <show_in_store>1</show_in_store>
332
+ <expanded>1</expanded>
333
+ <fields>
334
+ <enabled translate="label">
335
+ <label>Enabled</label>
336
+ <frontend_type>select</frontend_type>
337
+ <source_model>adminhtml/system_config_source_yesno</source_model>
338
+ <sort_order>1</sort_order>
339
+ <show_in_default>1</show_in_default>
340
+ <show_in_website>1</show_in_website>
341
+ <show_in_store>1</show_in_store>
342
+ </enabled>
343
+ <intro translate="lable">
344
+ <label>Intro</label>
345
+ <frontend_type>textarea</frontend_type>
346
+ <sort_order>2</sort_order>
347
+ <show_in_default>1</show_in_default>
348
+ <show_in_website>1</show_in_website>
349
+ <show_in_store>1</show_in_store>
350
+ <depends><enabled>1</enabled></depends>
351
+ </intro>
352
+ <enable_paging>
353
+ <label>Paging</label>
354
+ <frontend_type>select</frontend_type>
355
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
356
+ <sort_order>3</sort_order>
357
+ <show_in_default>1</show_in_default>
358
+ <show_in_website>1</show_in_website>
359
+ <show_in_store>1</show_in_store>
360
+ <depends><enabled>1</enabled></depends>
361
+ </enable_paging>
362
+ <paging_settings>
363
+ <label>Reviews per page</label>
364
+ <frontend_type>text</frontend_type>
365
+ <sort_order>4</sort_order>
366
+ <show_in_default>1</show_in_default>
367
+ <show_in_website>1</show_in_website>
368
+ <show_in_store>1</show_in_store>
369
+ <tooltip>Comma Separated, as: 10,20,30</tooltip>
370
+ <depends><enabled>1</enabled></depends>
371
+ </paging_settings>
372
+ <!--<add_toplink translate="label">
373
+ <label>Add a link to toplink</label>
374
+ <frontend_type>select</frontend_type>
375
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
376
+ <sort_order>4</sort_order>
377
+ <show_in_default>1</show_in_default>
378
+ <show_in_website>1</show_in_website>
379
+ <show_in_store>1</show_in_store>
380
+ </add_toplink>-->
381
+
382
+ <meta_title translate="lable">
383
+ <label>Meta Title</label>
384
+ <frontend_type>text</frontend_type>
385
+ <sort_order>11</sort_order>
386
+ <show_in_default>1</show_in_default>
387
+ <show_in_website>1</show_in_website>
388
+ <show_in_store>1</show_in_store>
389
+ <depends><enabled>1</enabled></depends>
390
+ </meta_title>
391
+ <meta_description translate="lable">
392
+ <label>Meta Description</label>
393
+ <frontend_type>textarea</frontend_type>
394
+ <sort_order>12</sort_order>
395
+ <show_in_default>1</show_in_default>
396
+ <show_in_website>1</show_in_website>
397
+ <show_in_store>1</show_in_store>
398
+ <depends><enabled>1</enabled></depends>
399
+ </meta_description>
400
+ <meta_keywords translate="label">
401
+ <label>Meta Keywords</label>
402
+ <frontend_type>textarea</frontend_type>
403
+ <sort_order>13</sort_order>
404
+ <show_in_default>1</show_in_default>
405
+ <show_in_website>1</show_in_website>
406
+ <show_in_store>1</show_in_store>
407
+ <depends><enabled>1</enabled></depends>
408
+ </meta_keywords>
409
+ </fields>
410
+ </overview>
411
+ <log translate="label">
412
+ <label>Trustpilot Log Settings</label>
413
+ <frontend_type>text</frontend_type>
414
+ <sort_order>9</sort_order>
415
+ <show_in_default>1</show_in_default>
416
+ <show_in_website>0</show_in_website>
417
+ <show_in_store>0</show_in_store>
418
+ <expanded>1</expanded>
419
+ <fields>
420
+ <enabled translate="label">
421
+ <label>Enable Log Function</label>
422
+ <frontend_type>select</frontend_type>
423
+ <source_model>adminhtml/system_config_source_yesno</source_model>
424
+ <sort_order>1</sort_order>
425
+ <show_in_default>1</show_in_default>
426
+ <show_in_website>0</show_in_website>
427
+ <show_in_store>0</show_in_store>
428
+ </enabled>
429
+ <clean translate="label">
430
+ <label>Auto Cleaning</label>
431
+ <frontend_type>select</frontend_type>
432
+ <source_model>adminhtml/system_config_source_yesno</source_model>
433
+ <sort_order>2</sort_order>
434
+ <show_in_default>1</show_in_default>
435
+ <show_in_website>0</show_in_website>
436
+ <show_in_store>0</show_in_store>
437
+ <depends><enabled>1</enabled></depends>
438
+ </clean>
439
+ <clean_days translate="label">
440
+ <label>Clean after Days</label>
441
+ <validate>validate-number</validate>
442
+ <frontend_type>text</frontend_type>
443
+ <sort_order>3</sort_order>
444
+ <show_in_default>1</show_in_default>
445
+ <show_in_website>0</show_in_website>
446
+ <show_in_store>0</show_in_store>
447
+ <depends><enabled>1</enabled></depends>
448
+ </clean_days>
449
+ </fields>
450
+ </log>
451
+ <snippets translate="label">
452
+ <label>Trustpilot Custom Blocks</label>
453
+ <frontend_type>text</frontend_type>
454
+ <sort_order>10</sort_order>
455
+ <show_in_default>1</show_in_default>
456
+ <show_in_website>1</show_in_website>
457
+ <show_in_store>1</show_in_store>
458
+ <expanded>1</expanded>
459
+ <comment><![CDATA[<p>The extension comes with two coded blocks.<br>With this blocks you can add your store rating in a Static block or CMS page.</p><p><br><strong>The Rich Snippets Block.<br></strong>Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.<br>Paste the code below at the desired location using a Static Block or a CMS page.</p><p>Code: {{block type="trustpilot/snippets" name="trustpilotsnippets"}}</p><p><br><strong>Custom Block.</strong><br>With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.<br>To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/trustpilot/widget/custom.phtml</p><p>Code: {{block type="trustpilot/custom" name="trustpilot"}}</p>]]></comment>
460
+ </snippets>
461
+ </groups>
462
+ </trustpilot>
463
+ </sections>
464
+ </config>
app/code/local/Magmodules/Trustpilot/sql/trustpilot_setup/mysql4-install-0.9.0.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+ $installer->run("
25
+ DROP TABLE IF EXISTS {$this->getTable('trustpilot_reviews')};
26
+ CREATE TABLE IF NOT EXISTS {$this->getTable('trustpilot_reviews')} (
27
+ `review_id` int(10) NOT NULL AUTO_INCREMENT,
28
+ `shop_id` int(5) NOT NULL,
29
+ `company` varchar(255) DEFAULT NULL,
30
+ `trustpilot_id` int(11) NOT NULL,
31
+ `title` varchar(255) NOT NULL,
32
+ `content` text,
33
+ `score` smallint(6) DEFAULT '0',
34
+ `stars` smallint(6) DEFAULT '0',
35
+ `human` varchar(255) DEFAULT NULL,
36
+ `stars_url_small` varchar(255) DEFAULT NULL,
37
+ `stars_url_medium` varchar(255) DEFAULT NULL,
38
+ `stars_url_large` varchar(255) DEFAULT NULL,
39
+ `user_name` varchar(255) DEFAULT NULL,
40
+ `user_city` varchar(255) DEFAULT NULL,
41
+ `user_locale` varchar(255) DEFAULT NULL,
42
+ `user_review_count` smallint(6) DEFAULT NULL,
43
+ `user_is_verified` tinyint(1) DEFAULT NULL,
44
+ `is_verified` tinyint(1) DEFAULT NULL,
45
+ `url` varchar(255) DEFAULT NULL,
46
+ `date_created` datetime NOT NULL,
47
+ `date_updated` datetime NOT NULL,
48
+ `sidebar` tinyint(1) NOT NULL DEFAULT '1',
49
+ `status` tinyint(5) NOT NULL DEFAULT '1',
50
+ PRIMARY KEY (`review_id`)
51
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
52
+
53
+ DROP TABLE IF EXISTS {$this->getTable('trustpilot_log')};
54
+ CREATE TABLE IF NOT EXISTS {$this->getTable('trustpilot_log')} (
55
+ `id` int(10) NOT NULL AUTO_INCREMENT,
56
+ `type` varchar(255) NOT NULL,
57
+ `shop_id` varchar(255) NOT NULL,
58
+ `company` varchar(255) DEFAULT NULL,
59
+ `review_update` int(5) DEFAULT '0',
60
+ `review_new` int(5) DEFAULT '0',
61
+ `response` text,
62
+ `order_id` int(10) DEFAULT NULL,
63
+ `cron` varchar(255) DEFAULT NULL,
64
+ `date` datetime NOT NULL,
65
+ `time` varchar(255) NOT NULL,
66
+ `api_url` text,
67
+ PRIMARY KEY (`id`)
68
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
69
+
70
+ DROP TABLE IF EXISTS {$this->getTable('trustpilot_stats')};
71
+ CREATE TABLE IF NOT EXISTS {$this->getTable('trustpilot_stats')} (
72
+ `id` int(5) NOT NULL AUTO_INCREMENT,
73
+ `company` varchar(255) DEFAULT NULL,
74
+ `shop_id` int(5) NOT NULL,
75
+ `human` varchar(255) DEFAULT NULL,
76
+ `score` smallint(6) DEFAULT '0',
77
+ `scoremax` smallint(6) DEFAULT '0',
78
+ `votes` int(5) DEFAULT '0',
79
+ `stars_url` varchar(255) DEFAULT NULL,
80
+ PRIMARY KEY (`id`)
81
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
82
+ ");
83
+ $installer->endSetup();
app/code/local/Magmodules/Trustpilot/sql/trustpilot_setup/mysql4-upgrade-0.9.0-1.0.0.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+ $installer->run("
25
+ ALTER TABLE {$this->getTable('trustpilot_reviews')} ADD `user_image` varchar(255) DEFAULT NULL AFTER `user_is_verified`;
26
+ ");
27
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/magmodules_trustpilot.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <adminhtml_trustpilotreviews_index>
4
+ <reference name="head">
5
+ <action method="addCss"><name>magmodules/trustpilot/grid.css</name></action>
6
+ </reference>
7
+ <reference name="content">
8
+ <block type="trustpilot/adminhtml_trustpilotreviews" name="trustpilot" />
9
+ </reference>
10
+ </adminhtml_trustpilotreviews_index>
11
+ <adminhtml_trustpilotlog_index>
12
+ <reference name="content">
13
+ <block type="trustpilot/adminhtml_trustpilotlog" name="trustpilotlog" />
14
+ </reference>
15
+ </adminhtml_trustpilotlog_index>
16
+ </layout>
app/design/frontend/base/default/layout/magmodules_trustpilot.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><stylesheet>magmodules/trustpilot/sidebar.css</stylesheet></action>
6
+ </reference>
7
+ <reference name="left">
8
+ <block type="trustpilot/sidebar" name="left.trustpilot" template="magmodules/trustpilot/sidebar/left.phtml" />
9
+ </reference>
10
+ <reference name="right">
11
+ <block type="trustpilot/sidebar" name="right.trustpilot" template="magmodules/trustpilot/sidebar/right.phtml" />
12
+ </reference>
13
+ </default>
14
+ <trustpilot_index_index>
15
+ <reference name="root">
16
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
17
+ </reference>
18
+ <reference name="head">
19
+ <action method="addCss"><stylesheet>magmodules/trustpilot/style.css</stylesheet> </action>
20
+ </reference>
21
+ <reference name="content">
22
+ <block type="trustpilot/reviews" name="trustpilot.index" template="magmodules/trustpilot/index.phtml" />
23
+ </reference>
24
+ <reference name="left">
25
+ <remove name="left.trustpilot" />
26
+ </reference>
27
+ <reference name="right">
28
+ <remove name="right.trustpilot" />
29
+ </reference>
30
+ </trustpilot_index_index>
31
+ <cms_index_index>
32
+ <reference name="head">
33
+ <action method="addCss"><stylesheet>magmodules/trustpilot/richsnippets.css</stylesheet></action>
34
+ </reference>
35
+ </cms_index_index>
36
+ </layout>
app/design/frontend/base/default/template/magmodules/trustpilot/index.phtml ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ ?>
23
+ <?php
24
+ // Load Reviews & Stats
25
+ $reviews = $this->getReviews();
26
+ $stats = $this->getStats();
27
+ ?>
28
+ <div class="trustpilot">
29
+
30
+ <div class="page-title">
31
+ <h1><?php echo $this->__('Trustpilot'); ?></h1>
32
+ <?php if(Mage::getStoreConfig('trustpilot/general/url')): ?>
33
+ <button class="button" onclick="setLocation('<?php echo Mage::getStoreConfig('trustpilot/general/url'); ?>')">
34
+ <span>
35
+ <span>
36
+ <?php echo $this->__('Write review');?>
37
+ </span>
38
+ </span>
39
+ </button>
40
+ <?php endif; ?>
41
+ </div>
42
+
43
+ <?php if($reviews->getSize()): ?>
44
+ <div class="content-trustpilot">
45
+ <div class="about-trustpilot">
46
+ <?php echo nl2br(Mage::getStoreConfig('trustpilot/overview/intro')); ?>
47
+ </div>
48
+ </div>
49
+
50
+ <?php $i=0; foreach($reviews as $review): ?>
51
+ <div class="review-list">
52
+ <div class="review-header">
53
+ <h3><?php echo $review->getTitle(); ?></h3>
54
+ <?php if($review->getScore()): ?>
55
+ <ul class="overall">
56
+ <li>
57
+ <img src="<?php echo $review->getStarsUrlSmall(); ?>" alt="review stars" class="trustpilot-review-stars"/>
58
+ </li>
59
+ </ul>
60
+ <?php endif; ?>
61
+ </div>
62
+ <ul class="experience">
63
+ <li>
64
+ <p>
65
+ <?php if($review->getContent()): ?>
66
+ <?php echo nl2br($review->getContent()); ?>
67
+ <?php else: ?>
68
+ &nbsp;
69
+ <?php endif; ?>
70
+ </p>
71
+ </li>
72
+ <li>
73
+ <i><?php echo $review->getUserName(); ?> - <?php echo Mage::helper('core')->formatDate($review->getDateCreated(), 'long', false); ?></i>
74
+ </li>
75
+ </ul>
76
+ </div>
77
+ <?php $i++; endforeach;?>
78
+ <?php echo $this->getPagerHtml(); ?>
79
+ <?php else: ?>
80
+ <p class="note-msg"><?php echo $this->__('No reviews found...'); ?></p>
81
+ <?php endif ?>
82
+ </div>
app/design/frontend/base/default/template/magmodules/trustpilot/sidebar/left.phtml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ $sidebarreviews = $this->getSidebarCollection('left');
23
+ $total = $this->getTotalScore();
24
+ ?>
25
+ <?php if($sidebarreviews && $total): ?>
26
+ <?php if($this->getSidebarStyle('left') == 'trustpilot'): ?>
27
+ <div class="truspilotbox">
28
+ <div class="tp-box" id="tp-iframe-widget">
29
+ <header>
30
+ <?php if($this->getSnippetsEnabled('left')): ?>
31
+ <div itemscope itemtype="http://schema.org/LocalBusiness">
32
+ <h1><?php echo $total->getHuman(); ?></h1>
33
+ <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
34
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="stars"/>
35
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10.00</span></strong></p>
36
+ <p class="review-count"><?php echo $this->__('%s customers have written a review on Trustpilot', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?>
37
+ </div>
38
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
39
+ </div>
40
+ <?php else: ?>
41
+ <h1><?php echo $total->getHuman(); ?></h1>
42
+ <img class="trustpilot-topstar" src="<?php echo $total->getStarsUrl(); ?>" alt="stars"/>
43
+ <p class="review-count"><?php echo $this->__('%s customers have written a review on Trustpilot', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?>
44
+ <?php endif ?>
45
+ </header>
46
+ <div class="truspilotbox-toptitle"><?php echo $this->__('Latest reviews'); ?></div>
47
+ <section class="reviews">
48
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
49
+ <?php $content = $this->formatContent($sidebarreview, 'left'); ?>
50
+ <article>
51
+ <img class="trustpilot-smallstar" src="<?php echo $sidebarreview->getStarsUrlSmall(); ?>" alt="review stars"/>
52
+ <time datetime="<?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?>"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></time>
53
+ <h3><?php echo $sidebarreview->getTitle(); ?></h3>
54
+ <p class="desc"><?php echo $content; ?></p>
55
+ <img src="<?php echo $sidebarreview->getUserImage(); ?>" alt="<?php echo $sidebarreview->getUserName(); ?>" class="user-img" />
56
+ <p class="author">
57
+ <?php echo $sidebarreview->getUserName(); ?><br />
58
+ <?php echo $sidebarreview->getCity(); ?>
59
+ </p>
60
+ </article>
61
+ <?php endforeach; ?>
62
+ </section>
63
+ <a class="truspilotbox-footer" href="<?php echo $this->getReviewsUrl(); ?>" target="_blank"><img src="<?php echo $this->getSkinUrl('magmodules/trustpilot/images/logo.png'); ?>" class="trustpilot-logo-footer"></a>
64
+ </div>
65
+ </div>
66
+ <?php else: ?>
67
+ <div class="block trustpilot-sidebar">
68
+ <div class="block-title">
69
+ <strong><span><?php echo $this->__('Trustpilot') ?></span></strong>
70
+ </div>
71
+ <?php if($total->getPercentage() > 0): ?>
72
+ <?php if($this->getSnippetsEnabled('left')): ?>
73
+ <div class="block-content" itemscope itemtype="http://schema.org/LocalBusiness">
74
+ <div class="trustpilot-human"><?php echo $total->getHuman(); ?></div>
75
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="review stars" class="trustpilot-stars"/>
76
+ <div class="total-block-text" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
77
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10.00</span></strong></p>
78
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
79
+ </div>
80
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
81
+ </div>
82
+ <?php else: ?>
83
+ <div class="block-content">
84
+ <div class="trustpilot-human"><?php echo $total->getHuman(); ?></div>
85
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="review stars" class="trustpilot-stars"/>
86
+ <div class="total-block-text">
87
+ <p><strong><?php echo $total->getStarsQty(); ?> / 10.00</strong></p>
88
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span>' . $total->getVotes() . '</span>'); ?></p>
89
+ </div>
90
+ </div>
91
+ <?php endif; ?>
92
+ <?php endif; ?>
93
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
94
+ <?php $content = $this->formatContent($sidebarreview, 'left'); ?>
95
+ <div class="block-content">
96
+ <div class="trustpilot-sidebar-block">
97
+ <p><u><?php echo $sidebarreview->getUserName(); ?></u>: "<?php echo $content; ?>"</p>
98
+ <span class="rating-name"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></span>
99
+ <img src="<?php echo $sidebarreview->getStarsUrlSmall(); ?>" alt="review stars" class="trustpilot-review-stars"/>
100
+ </div>
101
+ </div>
102
+ <?php endforeach; ?>
103
+ <div class="block-content">
104
+ <a href="<?php echo $this->getReviewsUrl(); ?>"><img src="<?php echo $this->getSkinUrl('magmodules/trustpilot/images/logo.png'); ?>" class="trustpilot-logo">
105
+ </div>
106
+ </div>
107
+ <?php endif; ?>
108
+ <?php endif; ?>
app/design/frontend/base/default/template/magmodules/trustpilot/sidebar/right.phtml ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ $sidebarreviews = $this->getSidebarCollection('right');
23
+ $total = $this->getTotalScore();
24
+ ?>
25
+ <?php if($sidebarreviews && $total): ?>
26
+ <?php if($this->getSidebarStyle('right') == 'trustpilot'): ?>
27
+ <div class="truspilotbox">
28
+ <div class="tp-box" id="tp-iframe-widget">
29
+ <header>
30
+ <?php if($this->getSnippetsEnabled('right')): ?>
31
+ <div itemscope itemtype="http://schema.org/LocalBusiness">
32
+ <h1><?php echo $total->getHuman(); ?></h1>
33
+ <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
34
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="stars"/>
35
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10.00</span></strong></p>
36
+ <p class="review-count"><?php echo $this->__('%s customers have written a review on Trustpilot', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?>
37
+ </div>
38
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
39
+ </div>
40
+ <?php else: ?>
41
+ <h1><?php echo $total->getHuman(); ?></h1>
42
+ <img class="trustpilot-topstar" src="<?php echo $total->getStarsUrl(); ?>" alt="stars"/>
43
+ <p class="review-count"><?php echo $this->__('%s customers have written a review on Trustpilot', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?>
44
+ <?php endif ?>
45
+ </header>
46
+ <div class="truspilotbox-toptitle"><?php echo $this->__('Latest reviews'); ?></div>
47
+ <section class="reviews">
48
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
49
+ <?php $content = $this->formatContent($sidebarreview, 'right'); ?>
50
+ <article>
51
+ <img class="trustpilot-smallstar" src="<?php echo $sidebarreview->getStarsUrlSmall(); ?>" alt="review stars"/>
52
+ <time datetime="<?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?>"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></time>
53
+ <h3><?php echo $sidebarreview->getTitle(); ?></h3>
54
+ <p class="desc"><?php echo $content; ?></p>
55
+ <img src="<?php echo $sidebarreview->getUserImage(); ?>" alt="<?php echo $sidebarreview->getUserName(); ?>" class="user-img" />
56
+ <p class="author">
57
+ <?php echo $sidebarreview->getUserName(); ?><br />
58
+ <?php echo $sidebarreview->getCity(); ?>
59
+ </p>
60
+ </article>
61
+ <?php endforeach; ?>
62
+ </section>
63
+ <a class="truspilotbox-footer" href="<?php echo $this->getReviewsUrl(); ?>" target="_blank"><img src="<?php echo $this->getSkinUrl('magmodules/trustpilot/images/logo.png'); ?>" class="trustpilot-logo-footer"></a>
64
+ </div>
65
+ </div>
66
+ <?php else: ?>
67
+ <div class="block trustpilot-sidebar">
68
+ <div class="block-title">
69
+ <strong><span><?php echo $this->__('Trustpilot') ?></span></strong>
70
+ </div>
71
+ <?php if($total->getPercentage() > 0): ?>
72
+ <?php if($this->getSnippetsEnabled('right')): ?>
73
+ <div class="block-content" itemscope itemtype="http://schema.org/LocalBusiness">
74
+ <div class="trustpilot-human"><?php echo $total->getHuman(); ?></div>
75
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="review stars" class="trustpilot-stars"/>
76
+ <div class="total-block-text" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
77
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10.00</span></strong></p>
78
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
79
+ </div>
80
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
81
+ </div>
82
+ <?php else: ?>
83
+ <div class="block-content">
84
+ <div class="trustpilot-human"><?php echo $total->getHuman(); ?></div>
85
+ <img src="<?php echo $total->getStarsUrl(); ?>" alt="review stars" class="trustpilot-stars"/>
86
+ <div class="total-block-text">
87
+ <p><strong><?php echo $total->getStarsQty(); ?> / 10.00</strong></p>
88
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span>' . $total->getVotes() . '</span>'); ?></p>
89
+ </div>
90
+ </div>
91
+ <?php endif; ?>
92
+ <?php endif; ?>
93
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
94
+ <?php $content = $this->formatContent($sidebarreview, 'right'); ?>
95
+ <div class="block-content">
96
+ <div class="trustpilot-sidebar-block">
97
+ <p><u><?php echo $sidebarreview->getUserName(); ?></u>: "<?php echo $content; ?>"</p>
98
+ <span class="rating-name"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></span>
99
+ <img src="<?php echo $sidebarreview->getStarsUrlSmall(); ?>" alt="review stars" class="trustpilot-review-stars"/>
100
+ </div>
101
+ </div>
102
+ <?php endforeach; ?>
103
+ <div class="block-content">
104
+ <a href="<?php echo $this->getReviewsUrl(); ?>"><img src="<?php echo $this->getSkinUrl('magmodules/trustpilot/images/logo.png'); ?>" class="trustpilot-logo">
105
+ </div>
106
+ </div>
107
+ <?php endif; ?>
108
+ <?php endif; ?>
app/design/frontend/base/default/template/magmodules/trustpilot/widget/custom.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ // Load data
24
+ $enabled = $this->getTrustpilotEnabled();
25
+ $data = $this->getTrustpilotData();
26
+
27
+ // All available data
28
+ $company = $data->getCompany();
29
+ $percentage = $data->getPercentage();
30
+
31
+ ?>
32
+ <?php if($enabled) { ?>
33
+ <div class="trustpilot-custom">
34
+ <div class="client">Client rating <?php echo $company; ?></div>
35
+ <div class="rating-box">
36
+ <div class="rating" style="width:<?php echo $percentage; ?>%"> </div>
37
+ </div>
38
+ </div>
39
+ <?php } ?>
app/design/frontend/base/default/template/magmodules/trustpilot/widget/richsnippets.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Trustpilot
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ ?>
23
+ <?php if(($this->getSnippetsEnabled()) && ($snippets = $this->getSnippets())) { ?>
24
+ <div class="trustpilot-snippets">
25
+ <?php echo $this->getHtmlStars($snippets->getPercentage()); ?>
26
+ <div itemscope="itemscope" itemtype="http://schema.org/Product">
27
+ <meta itemprop="name" content="<?php echo $snippets->getCompany(); ?>">
28
+ <div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
29
+ <meta itemprop="bestRating" content="100">
30
+ <p><?php echo Mage::helper('trustpilot')->__('Rating %s based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets->getPercentage() . '</span>%', '<span itemprop="ratingCount">' . $snippets->getVotes() . '</span>') ?> <?php echo $this->getExternalLink(); ?> </p>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <?php } ?>
app/etc/modules/Magmodules_Trustpilot.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magmodules_Trustpilot>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Magmodules_Trustpilot>
8
+ </modules>
9
+ </config>
app/locale/en_US/Magmodules_Trustpilot.csv ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "(more)","(more)"
2
+ "%s review(s) updated","%s review(s) updated"
3
+ "%s customers have written a review on Trustpilot","%s customers have written a review on Trustpilot"
4
+ "Activate,"Activate"
5
+ "Add Rich Snippets","Add Rich Snippets"
6
+ "Add to Sidebar","Add to Sidebar"
7
+ "Add to Sidebar Homepage","Add to Sidebar Homepage"
8
+ "Aftersales","Aftersales"
9
+ "API CREDENTIALS","API CREDENTIALS"
10
+ "Are you sure you want to cleanup logfiles?","Are you sure you want to cleanup logfiles?"
11
+ "Are you sure you want to delete all reviews?","Are you sure you want to delete all reviews?"
12
+ "Auto Cleaning","Auto Cleaning"
13
+ "Based on %s reviews","Based on %s reviews"
14
+ "Can be obtained from the Trustpilot Dashboard","Can be obtained from the Trustpilot Dashboard"
15
+ "Change only if necessary","Change only if necessary"
16
+ "Character length of Reviews","Character length of Reviews"
17
+ "Connector Code","Connector Code"
18
+ "Company","Company"
19
+ "Clean after Days","Clean After Days"
20
+ "Cleanup Log","Cleanup Log"
21
+ "Client rating ","Client rating "
22
+ "Delay","Delay"
23
+ "Delete all reviews","Delete all reviews"
24
+ "Delivery","Delivery"
25
+ "Delivery Time","Delivery Time"
26
+ "Enable Log Function","Enable Log Function"
27
+ "Enabled","Enabled"
28
+ "Experience","Experience"
29
+ "Every 15 minutes","Every 15 minutes"
30
+ "Every Hour","Every Hour"
31
+ "Every other Hour","Every other Hour"
32
+ "Twice a Day","Twice a Day"
33
+ "Once a Day","Once a Day"
34
+ "Once a Week","Once a Week"
35
+ "Trustpilot Config","Trustpilot Config"
36
+ "Trustpilot Custom Blocks","Trustpilot Custom Blocks"
37
+ "Trustpilot Import Reviews","Trustpilot Import Reviews"
38
+ "Trustpilot Log","Trustpilot Log"
39
+ "Trustpilot Log Settings","Trustpilot Log Settings"
40
+ "Trustpilot Overview Page","Trustpilot Overview Page"
41
+ "Trustpilot Reviews","Trustpilot Reviews"
42
+ "Trustpilot Reviews Sidebar","Trustpilot Reviews Sidebar"
43
+ "Trustpilot Rich Snippets","Trustpilot Rich Snippets"
44
+ "Friendlyness","Friendlyness"
45
+ "General Configuration","General Configuration"
46
+ "Import Automatically","Import Automatically"
47
+ "Invitation Call","Invitation Call"
48
+ "Intro","Intro"
49
+ "Invitation e-mail is sent after such status is achieved","Invitation e-mail is sent after such status is achieved"
50
+ "Invitation to write the customer experience","Invitation to write the customer experience"
51
+ "If yes, customers will get new review reminders for every new order.","If yes, customers will get new review reminders for every new order."
52
+ "Last Update","Last Update"
53
+ "Latest reviews","Latest reviews"
54
+ "Latest Reviews Visibility","Latest Reviews Visibility"
55
+ "Left Sidebar","Left Sidebar"
56
+ "Link","Link"
57
+ "Link to","Link to"
58
+ "Logs can be activated in order to detect errors.<br/> This feature is particularly for developers.<br/><br/>","Logs can be activated in order to detect errors.<br/> This feature is particularly for developers.<br/><br/>"
59
+ "Manage Reviews","Manage Reviews"
60
+ "Manage Log","Manage Logs"
61
+ "Maximum Delay","Maximum Delay"
62
+ "Meta Data","Meta Data"
63
+ "Meta Description","Meta Description"
64
+ "Meta Keywords","Meta Keywords"
65
+ "Meta Title","Meta Title"
66
+ "Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Trustpilot.nl.","Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Trustpilot.nl."
67
+ "Number of Reviews","Number of Reviews"
68
+ "Order completed with status","Order is Completed with status"
69
+ "Pagination","Pagination"
70
+ "Pagination is the process of dividing (content) into discrete pages","Pagination is the process of dividing (content) into discrete pages"
71
+ "Place of the sidebar","Place of the sidebar"
72
+ "Placement from top screen","Placement from top screen"
73
+ "Please select item(s)","Please select item(s)"
74
+ "Price / Quality","Price / Quality"
75
+ "Price Quality","Price Quality"
76
+ "Process Manually","Process Manually"
77
+ "Rating %s based on %s customer reviews","Rating %s based on %s customer reviews"
78
+ "Read More","Read More"
79
+ "Remove from Sidebar","Remove from Sidebar"
80
+ "Remind Delay,"Remind Delay"
81
+ "Resend if Double","Resend if Double"
82
+ "Reviews per page","Reviews per page"
83
+ "Rich Snippets is a schema.org markup that makes it possible to give richer and more specific information. <br/> The Rich Snippets will show your store rating in the google search engine results. <br/><br/>Use: {{block type=""trustpilot/snippets"" name=""webwinkelsnippets""}} to call the block on the homepage.<br/><br/>","Rich Snippets is a schema.org markup that makes it possible to give richer and more specific information. <br/> The Rich Snippets will show your store rating in the google search engine results. <br/><br/>Use: {{block type=""trustpilot/snippets"" name=""webwinkelsnippets""}} to call the block on the homepage.<br/><br/>"
84
+ "Right Sidebar","Right Sidebar"
85
+ "Select the schedule for automatic updating","Select the schedule for automatic updating"
86
+ "Set to invisible","Set to invisible"
87
+ "Set to visible","Set to visible"
88
+ "Shop","Shop",
89
+ "Show Sidebar","Show Sidebar"
90
+ "Show the latest reviews directly in the right or left area of your store to gain trust and directly show your client reviews.<br/><br/>","Show the latest reviews directly in the right or left area of your store to gain trust and directly show your client reviews.<br/><br/>"
91
+ "Showing the sidebar ensures a higher confidence. Visitors also do not have to leave to check the reviews which increases your conversion.","Showing the sidebar ensures a higher confidence. Visitors also do not have to leave to check the reviews which increases your conversion."
92
+ "Showing the sidebar ensures a higher confidence. Visitors can read the reviews without leaving the store.","Showing the sidebar ensures a higher confidence. Visitors can read the reviews without leaving the store."
93
+ "Sidebar","Sidebar"
94
+ "Sidebar Position","Sidebar Position"
95
+ "Specify at which status you want to send the invitation. Default is ""Completed""","Specify at which status you want to send the invitation. Default is ""Completed""."
96
+ "Succefully deleted all %s saved review(s).","Succefully deleted all %s saved review(s)."
97
+ "The Feedback Company","The Feedback Company"
98
+ "The Feedback Company ID","The Feedback Company ID"
99
+ "The position of the sidebar","The position of the sidebar"
100
+ "This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience.","This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience."
101
+ "To display the latest reviews in your store, you must import the reviews. This can be done automatically or manually.","To display the latest reviews in your store, you must import the reviews. This can be done automatically or manually."
102
+ "Tooltip","Tooltip"
103
+ "Total of %d review(s) were added to the sidebar.","Total of %d review(s) were added to the sidebar."
104
+ "Total of %d review(s) were disabled.","Total of %d review(s) were disabled."
105
+ "Total of %d review(s) were enabled.","Total of %d review(s) were enabled."
106
+ "Total of %d review(s) were removed from the sidebar.","Total of %d review(s) were removed from the sidebar."
107
+ "total score updated.","total score updated."
108
+ "Update Review History","Update Review History"
109
+ "Update Reviews","Update Reviews"
110
+ "Update Summary","Update Summary"
111
+ "URL","URL"
112
+ "Use Cronjob","Use Cronjob"
113
+ "View all reviews","View all reviews"
114
+ "You can only activate the Rich Snippets when this block is shown on your Homepage only","You can only activate the Rich Snippets when this block is shown on your Homepage only"
app/locale/nl_NL/Magmodules_Trustpilot.csv ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "(more)","(more)"
2
+ "%s review(s) updated","%s review(s) updated"
3
+ "%s customers have written a review on Trustpilot","%s klanten hebben een beoordeling geschreven op Trustpilot"
4
+ "Activate,"Activeer"
5
+ "Add Rich Snippets","Voeg Rich Snippets toe"
6
+ "Add to Sidebar","Voeg toe aan sidebar"
7
+ "Add to Sidebar Homepage","Voeg toe aan homepage sidebar"
8
+ "Aftersales","Aftersales"
9
+ "API CREDENTIALS","API Gegevens"
10
+ "Are you sure you want to cleanup logfiles?","Alle logfiles opschonen?"
11
+ "Are you sure you want to delete all reviews?","Alle beoordelingen verwijderen?"
12
+ "Auto Cleaning","Automatisch opschonen"
13
+ "Based on %s reviews","Gebaseerd op %s beoordelingen"
14
+ "Can be obtained from the Trustpilot Dashboard","Deze wordt weergegeven in uw dashboard in uw Trustpilot account"
15
+ "Change only if necessary","Verander alleen indien noodzakelijk"
16
+ "Character length of Reviews","Character length of Reviews"
17
+ "Connector Code","Connector code"
18
+ "Company","Bedrijf"
19
+ "Clean after Days","Schoon op na aantal dagen"
20
+ "Cleanup Log","Log opschonen"
21
+ "Client rating ","Klantbeoordeling "
22
+ "Delay","Vertraging"
23
+ "Delete all reviews","Verwijder alle beoordelingen"
24
+ "Delivery","Aankomst"
25
+ "Delivery Time","Aankomst tijd"
26
+ "Enable Log Function","Activeer log functie"
27
+ "Enabled","Inschakelen"
28
+ "Experience","Ervaring"
29
+ "Every 15 minutes","Elke 15 minuten"
30
+ "Every Hour","Elk uur"
31
+ "Every other Hour","Om het uur"
32
+ "Twice a Day","2 keer per dag"
33
+ "Once a Day","1 keer per dag"
34
+ "Once a Week","1 keer per week"
35
+ "Trustpilot Config","Trustpilot Instellingen"
36
+ "Trustpilot Custom Blocks","Trustpilot Blokken"
37
+ "Trustpilot Import Reviews","Trustpilot Beoordelingen Importeren"
38
+ "Trustpilot Log","Trustpilot Log"
39
+ "Trustpilot Log Settings","Trustpilot Log Instellingen"
40
+ "Trustpilot Overview Page","Trustpilot Overzicht Page"
41
+ "Trustpilot Reviews","Trustpilot Reviews"
42
+ "Trustpilot Reviews Sidebar","Trustpilot Beoordelingen Sidebar"
43
+ "Trustpilot Rich Snippets","Trustpilot Rich Snippets"
44
+ "Friendlyness","Gebruiksvriendelijkheid"
45
+ "General Configuration","Algemene instellingen"
46
+ "Import Automatically","Automatisch importeren"
47
+ "Invitation Call","Uitnodiging sturen"
48
+ "Intro","Intro"
49
+ "Invitation e-mail is sent after such status is achieved","De uitnodiging wordt verstuurd als deze status is bereikt"
50
+ "Invitation to write the customer experience","Uitnodiging om een beoordeling te schrijven"
51
+ "If yes, customers will get new review reminders for every new order.","Indien ja ontvangen klanten bij elke order een herinnering voor het schrijven van een beoordeling."
52
+ "Last Update","Laatste update"
53
+ "Latest Reviews Visibility","Laatste beoordelingen zichtbaarheid"
54
+ "Latest reviews","Laatste beoordelingen"
55
+ "Left Sidebar","Linker Sidebar"
56
+ "Link","Link"
57
+ "Link to","Link naar"
58
+ "Logs can be activated in order to detect errors.<br/> This feature is particularly for developers.<br/><br/>","De logfile kan worden ingeschakeld om foutmeldingen op te slaan.<br/>Deze functie is gemaakt voor ontwikkelaars.<br/><br/>"
59
+ "Manage Reviews","Beheer Beoordelingen "
60
+ "Manage Log","Beheer Logfiles"
61
+ "Maximum Delay","Maximum vertraging"
62
+ "Meta Data","Meta data"
63
+ "Meta Description","Meta omschrijving"
64
+ "Meta Keywords","Meta zoekwoorden"
65
+ "Meta Title","Meta titel"
66
+ "Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Trustpilot.nl.","Het maximaal aantal dagen tot een order compleet is, als het langer duurt zal er dus geen uitnodiging worden verstuurd. Lees meer hiervoer op Trustpilot.nl."
67
+ "Number of Reviews","Aantal beoordelingen"
68
+ "Order completed with status","Order is compleet met status"
69
+ "Pagination","Pagina's scheiden"
70
+ "Pagination is the process of dividing (content) into discrete pages","Dit verdeelt een lange pagina in meerder pagina's "
71
+ "Place of the sidebar","Plaats van de sidebar"
72
+ "Placement from top screen","Positie in topscherm"
73
+ "Please select item(s)","Selecteer item(s)"
74
+ "Price / Quality","Prijs / Kwaliteit"
75
+ "Price Quality","Prijs Kwaliteit"
76
+ "Process Manually","Voer handmatig uit"
77
+ "Rating %s based on %s customer reviews","Score %s gebaseerd op %s klantenbeoordelingen"
78
+ "Read More","Lees meer"
79
+ "Remove from Sidebar","Verwijder uit sidebar"
80
+ "Reviews per page","Beoordelingen per pagina"
81
+ "Rich Snippets is a schema.org markup that makes it possible to give richer and more specific information. <br/> The Rich Snippets will show your store rating in the google search engine results. <br/><br/>Use: {{block type=""trustpilot/snippets"" name=""webwinkelsnippets""}} to call the block on the homepage.<br/><br/>","Rich Snippets is a schema.org markup that makes it possible to give richer and more specific information. <br/> The Rich Snippets will show your store rating in the google search engine results. <br/><br/>Use: {{block type=""trustpilot/snippets"" name=""webwinkelsnippets""}} to call the block on the homepage.<br/><br/>"
82
+ "Right Sidebar","Rechter sidebar"
83
+ "Select the schedule for automatic updating","Selecteer de tijd voor het automatisch bijwerken"
84
+ "Set to invisible","Maak ontzichtbaar"
85
+ "Set to visible","Maak zichtbaar"
86
+ "Shop","Winkel",
87
+ "Show Sidebar","Toon Sidebar"
88
+ "Show the latest reviews directly in the right or left area of your store to gain trust and directly show your client reviews.<br/><br/>","Show the latest reviews directly in the right or left area of your store to gain trust and directly show your client reviews.<br/><br/>"
89
+ "Showing the sidebar ensures a higher confidence. Visitors also do not have to leave to check the reviews which increases your conversion.","Showing the sidebar ensures a higher confidence. Visitors also do not have to leave to check the reviews which increases your conversion."
90
+ "Showing the sidebar ensures a higher confidence. Visitors can read the reviews without leaving the store.","Showing the sidebar ensures a higher confidence. Visitors can read the reviews without leaving the store."
91
+ "Sidebar","Sidebar"
92
+ "Sidebar Position","Sidebar Positie"
93
+ "Specify at which status you want to send the invitation. Default is ""Completed""","Specificeer de status waarnaar de uitnodiging verstuurd kan worden, standaard is dit ""Completed""."
94
+ "Succefully deleted all %s saved review(s).","Alle %s opgeslagen beoordelingen zijn verwijdert."
95
+ "The Feedback Company","De Feedback Company"
96
+ "<p>The extension comes with two coded blocks.<br>With this blocks you can add your store rating in a Static block or CMS page.</p><p><br><strong>The Rich Snippets Block.<br></strong>Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.<br>Paste the code below at the desired location using a Static Block or a CMS page.</p><p>Code: {{block type=""trustpilot/snippets"" name=""trustpilotsnippets""}}</p><p><br><strong>Custom Block.</strong><br>With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.<br>To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/trustpilot/widget/custom.phtml</p><p>Code: {{block type=""trustpilot/custom"" name=""trustpilot""}}</p>","<p>Deze extensie komt met 2 verschillende blokken<br>With this blocks you can add your store rating in a Static block or CMS page.</p><p><br><strong>Het Rich Snippets blok.</strong><br></strong>Toon de webwinkel-waardering met in blok en genereer hiermee de zogenaamde Rich Snippets waarbij de winkelbeoordelingen worden getoond in de Zoekmachine resultaten van bijvoorbeeld Google. Plaat de onderstaande code op de gewenste plaats in een statische blok of een CMS-pagina.</p> <p><strong>De code: </strong>{{block type=""trustpilot/snippets"" name=""trustpilotsnippets""}}</p><p><br><strong>Custom blok.</strong><br>Met dit custom blok is het mogelijk om eenvoudig een eigen blok creëren met daarin verschillende waardes als het aantal klanbeoordelingen, bedrijfsnaam en gemiddelde rating. Plaats de onderstaande code op de gewenste plek in een statisch blok of een CMS-pagina. Om dit blok naar wens te bewerken en eventueel aan te vullen met de geweneste informatie is het mogelijk om het .phtml bestand aan te passen. Deze is te vinden via de volgende path: app/design/frontend/base/default/template/magmodules/webwinkelconnect/widget/custom.phtml </p><p><strong>De code:</strong> {{block type=""trustpilot/custom"" name=""trustpilot""}}</p>"
97
+ "The Feedback Company ID","De Feedback winkel ID"
98
+ "The position of the sidebar","De positie van de sidebar"
99
+ "This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience.","Creëer een vertraging om er zeker van te zijn dat de klant het product heeft ontvangen en/of heeft gebruikt, op deze manier is de kans groter dat de klant daadwerkelijk de bevindingen gaat delen."
100
+ "To display the latest reviews in your store, you must import the reviews. This can be done automatically or manually.","Om de beoordelingen te tonen dien je deze eerst te importeren, dit kan handmatig en automatisch."
101
+ "Tooltip","Tooltip"
102
+ "Total of %d review(s) were added to the sidebar.","Een totaal van %d beoordeling(en) zijn toegevoegd aan de sidebar."
103
+ "Total of %d review(s) were disabled.","Een totaal van %d beoordeling(en) zijn uitgeschakeld."
104
+ "Total of %d review(s) were enabled.","Een totaal van %d beoordeling(en)zijn uitgeschakeld."
105
+ "Total of %d review(s) were removed from the sidebar.","Een totaal van %d beoordeling(en) zijn verwijdert uit de sidebar."
106
+ "total score updated.","Totaalscore bijgewerkt."
107
+ "Update Review History","Update beoordeling historie"
108
+ "Update Reviews","Update beoordelingen"
109
+ "Update Summary","Update samenvatting"
110
+ "URL","URL"
111
+ "Use Cronjob","Gebruik cronjob"
112
+ "View all reviews","Bekijk alle beoordelingen"
113
+ "You can only activate the Rich Snippets when this block is shown on your Homepage only","De Rich Snippets kunnen alleen geactiveerd worden wanneer het homepage blok is toegevoegd, de code staat onderaan deze pagina."
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Magmodules_Trustpilot</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license/>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Connect your Magento shop to The Feedback Company</summary>
10
+ <description>Connect your Magento shop to The Feedback Company</description>
11
+ <notes>First stable release</notes>
12
+ <authors><author><name>Magmodules</name><user>auto-converted</user><email>info@magmodules.nl</email></author></authors>
13
+ <date>2014-11-03</date>
14
+ <time>16:11:56</time>
15
+ <contents><target name="magelocal"><dir name="Magmodules"><dir name="Trustpilot"><dir name="Block"><dir name="Adminhtml"><dir name="Trustpilotlog"><file name="Grid.php" hash="1d0393c4292c5b6bf924b1d898fe1489"/></dir><dir name="Trustpilotreviews"><dir name="Renderer"><file name="Experience.php" hash="56cd001e25933e6f717b8bbadfdfcdc1"/></dir><file name="Grid.php" hash="de8e87e480fd17ca720bb889eb41984d"/></dir><dir name="Widget"><dir name="Buttons"><file name="Process.php" hash="f88e0b904b4fdfe6c499c67ee63bf4cd"/></dir><dir name="Form"><file name="Heading.php" hash="d4240108d265b16e30f98aa02d89fdc2"/></dir><dir name="Grid"><file name="Log.php" hash="58591e425491b28ab6f9a7406417bcfa"/><file name="Seconds.php" hash="62bd740dc21beb7eb9f8ff246100472f"/><file name="Stars.php" hash="a18d4771c304e9f2fc3976730df2e046"/></dir><dir name="Info"><file name="Info.php" hash="3afd024fcefcd56f494b928cf5822f3d"/></dir></dir><file name="Trustpilotlog.php" hash="69a09905d4e8f4e53f5e3baaedc2d629"/><file name="Trustpilotreviews.php" hash="6c846808a318948c1230d51cb1a0cd1b"/></dir><file name="Custom.php" hash="a2f14b2502a879da72df3b54cef4283e"/><file name="Reviews.php" hash="d7d571bbad61d22a5c0cd842dacc33ec"/><file name="Sidebar.php" hash="56dc441e0d0769444c4c106ef40781cc"/><file name="Snippets.php" hash="8815c37edc5e51ae01cec6cd3dff88a8"/></dir><dir name="Helper"><file name="Data.php" hash="f5d74e0ccd5062f07bc8b57c20597fce"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="67a8cc90f0373834af154b78ba1d221c"/></dir><dir name="Reviews"><file name="Collection.php" hash="575e14b7bb94d7caf36b11163a25415d"/></dir><dir name="Stats"><file name="Collection.php" hash="f46da181a9ea2ee4def015cf38b1506d"/></dir><file name="Log.php" hash="ba3cb0ec65bfd14bfd5c500c6cc1be97"/><file name="Reviews.php" hash="ed6eba1a4a104578009a14f712b88d95"/><file name="Stats.php" hash="83ef36cc25b1bdcea3bb68725b2777d8"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Cronfrequency.php" hash="1b0d3fbb6471391d5f5bb63191f5950a"/><file name="Orderstatus.php" hash="cc0f2903f29abb21bf27be1cba911c74"/><file name="Position.php" hash="990add06e5acc227e9f2603d4c7448ae"/><file name="Sidebarlink.php" hash="fa59946b89bdf5cd3939978860706bf9"/><file name="Sidebarstyle.php" hash="a6daee24f617f127dae491af9f8b3d75"/></dir></dir></dir><file name="Api.php" hash="6b86e2a47f6cdfc88637fd1a75509792"/><file name="Log.php" hash="1081140ad66a8de337a700cfdf0b2ea7"/><file name="Observer.php" hash="44277db1b4ec0e9fbd1cb1d433f21733"/><file name="Reviews.php" hash="57ddcf0cfbcedeb0bd5b626a2b6b2386"/><file name="Stats.php" hash="e53dee77eecd84273b43c97faca66bff"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="TrustpilotlogController.php" hash="42cb795593c0db3fece3eee848b4ce7d"/><file name="TrustpilotreviewsController.php" hash="fa2539b9dfb1157541db36a281e34155"/></dir><file name="IndexController.php" hash="fa12a86ff5ddf21351ed23da4e594eb6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0ecaeda62a21023b1fe4cb0a598c632a"/><file name="config.xml" hash="dcd583139041f83c38c48298b9ac320d"/><file name="system.xml" hash="6fbda6393b34fd0042db975b243d4c46"/></dir><dir name="sql"><dir name="trustpilot_setup"><file name="mysql4-install-0.9.0.php" hash="7033a3cb0486d615e5f77dac7ba9fd63"/><file name="mysql4-upgrade-0.9.0-1.0.0.php" hash="054e4cfe0524f75ab08458146665738c"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magmodules_trustpilot.xml" hash="a0c6f67972408bcc01d798d7ad6a3ed9"/></dir><dir name="template"><dir name="magmodules"><dir name="trustpilot"><dir name="sidebar"><file name="left.phtml" hash="4dd3bf938e954e2e1bf6022637d4c2da"/><file name="right.phtml" hash="5f683200465ec78a0120abf166904524"/></dir><dir name="widget"><file name="custom.phtml" hash="3d201adffc83966bb60c224065dbf37f"/><file name="richsnippets.phtml" hash="ae9046c4ec34a78af6dcdadbef0dbeec"/></dir><file name="index.phtml" hash="3b03f4c41308e6cb9d5ea8da5488a84d"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="magmodules_trustpilot.xml" hash="285cf7890eed0dbf4cb79fc5342fc7d2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Trustpilot.xml" hash="ef276abf28d9d1a59cab187ea5e68c2b"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Magmodules_Trustpilot.csv" hash="16d0e330a00d0770c8e02ffee248ce52"/></dir><dir name="nl_NL"><file name="Magmodules_Trustpilot.csv" hash="3ad32035be57cc3b95ea4a676e046ea6"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="magmodules"><dir name="trustpilot"><dir name="images"><file name="5-stars-empty.png" hash="799c499ca785331e7e69d892df52dd48"/><file name="5-stars-full.png" hash="1d06151a2c4da6bb71381538c8a903a5"/><file name="greystar.png" hash="ab99888c7a8f47826ad7a83bcabf9130"/><file name="logo.png" hash="7dc164baee77a185d41abfa3f72b1f8a"/><file name="star.png" hash="647c77f0ef881fb2a90a4f53f70d75fa"/></dir><file name="richsnippets.css" hash="ff523f98d2edbcd62143d9f09e504f22"/><file name="sidebar.css" hash="fbd3d3fdc1016063aeda0f719fc8c091"/><file name="style.css" hash="b9e1a386f033380394aa9f8431df9f79"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magmodules"><dir name="trustpilot"><file name="grid.css" hash="90a8ac7d668d2ea9a7dc84632e639847"/><file name="star.png" hash="4beacfb62ebdd5feecd946494e895f4c"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/adminhtml/default/default/magmodules/trustpilot/grid.css ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
3
+ * =============================================================
4
+ * NOTICE OF LICENSE [Single domain license]
5
+ * This source file is subject to the EULA that is
6
+ * available through the world-wide-web at:
7
+ * http://www.magmodules.eu/license-agreement/
8
+ * =============================================================
9
+ * @category Magmodules
10
+ * @package Magmodules_Shopreview
11
+ * @author Magmodules <info@magmodules.eu>
12
+ * @copyright Copyright (c) 2013 (http://www.magmodules.eu)
13
+ * @license http://www.magmodules.eu/license-agreement/
14
+ * =============================================================
15
+ */
16
+
17
+ /** RATINGS ORDER GRID **/
18
+ .rating-empty, .rating-star-1, .rating-star-2, .rating-star-3, .rating-star-4, .rating-star-5 {
19
+ background: url('star.png') 0 0;
20
+ margin-right: 5px;
21
+ height: 16px;
22
+ float: left;
23
+ width: 80px;
24
+ }
25
+
26
+ .rating-star-1 {
27
+ width: 16px;
28
+ }
29
+
30
+ .rating-star-2 {
31
+ width: 32px;
32
+ }
33
+
34
+ .rating-star-3 {
35
+ width: 48px;
36
+ }
37
+
38
+ .rating-star-4 {
39
+ width: 64px;
40
+ }
41
+
42
+ .rating-star-5 {
43
+ width: 80px;
44
+ }
45
+
46
+ .rating-empty {
47
+ float: left;
48
+ width: 80px;
49
+ background: url('star.png') 0 -16px;
50
+ }
51
+
52
+ a.magtooltip span {
53
+ display:none;
54
+ padding:2px 3px;
55
+ margin-left:8px;
56
+ width:550px;
57
+ }
58
+
59
+ a.magtooltip:hover span {
60
+ display:inline;
61
+ position:absolute;
62
+ background:#ffffff;
63
+ border:1px solid #cccccc;
64
+ color:#000;
65
+ padding: 10px;
66
+ }
67
+
68
+ .magtooltip hr {
69
+ height:1px;
70
+ border: 1px dotted #606;
71
+ }
skin/adminhtml/default/default/magmodules/trustpilot/star.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/images/5-stars-empty.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/images/5-stars-full.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/images/greystar.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/images/logo.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/images/star.png ADDED
Binary file
skin/frontend/base/default/magmodules/trustpilot/richsnippets.css ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu
3
+ * http://www.magmodules.eu
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 info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Trustpilot
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ .trustpilot-snippets .rating-box {
23
+ float: left;
24
+ margin-right: 4px;
25
+ margin-top: 0px;
26
+ width:69px;
27
+ height:13px;
28
+ font-size:0;
29
+ line-height:0;
30
+ background:url('images/bkg_rating.gif') 0 0 repeat-x;
31
+ text-indent:-999em;
32
+ overflow:hidden;
33
+ }
34
+
35
+ .trustpilot-snippets-snippets .rating {
36
+ float:left;
37
+ height:13px;
38
+ background:url('images/bkg_rating.gif') 0 100% repeat-x;
39
+ }
40
+
41
+ /** FOR DEFAULT USE OF RATING STARTS, REMOVE BOTH CLASSES FROM CSS **/
skin/frontend/base/default/magmodules/trustpilot/sidebar.css ADDED
@@ -0,0 +1,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
3
+ * =============================================================
4
+ * NOTICE OF LICENSE [Single domain license]
5
+ * This source file is subject to the EULA that is
6
+ * available through the world-wide-web at:
7
+ * http://www.magmodules.eu/license-agreement/
8
+ * =============================================================
9
+ * @category Magmodules
10
+ * @package Magmodules_Trustpilot
11
+ * @author Magmodules <info@magmodules.eu>
12
+ * @copyright Copyright (c) 2013 (http://www.magmodules.eu)
13
+ * @license http://www.magmodules.eu/license-agreement/
14
+ * =============================================================
15
+ */
16
+
17
+ .trustpilot-sidebar-block {
18
+ padding: 0px;
19
+ }
20
+
21
+ .truspilotbox-toptitle {
22
+ background-color: #DDDDDD;
23
+ padding: 5px 10px;
24
+ font-size: 15px;
25
+ font-weight: 700;
26
+ color: #444444;
27
+ }
28
+
29
+ .trustpilot-topstar {
30
+ margin-left: auto;
31
+ margin-right: auto;
32
+ margin-top: -6px;
33
+ }
34
+
35
+ .trustpilot-smallstar {
36
+ float:left;
37
+ }
38
+
39
+ .truspilotbox-footer {
40
+ background-color: #DDDDDD;
41
+ display: block;
42
+ padding: 10px 5px 5px 10px;
43
+ margin-top: -13px;
44
+ }
45
+
46
+ .trustpilot-logo-footer {
47
+ width:100px;
48
+ }
49
+
50
+ .trustpilot-sidebar-block .rating-name {
51
+ font-style: italic;
52
+ vertical-align: middle;
53
+ }
54
+
55
+ img.trustpilot-logo {
56
+ display: block;
57
+ margin: 0 auto;
58
+ }
59
+
60
+ img.trustpilot-stars {
61
+ display: block;
62
+ margin: 0 auto;
63
+ }
64
+
65
+ img.trustpilot-review-stars{
66
+ float: right;
67
+ margin-top: 2px;
68
+ }
69
+
70
+ .trustpilot-human {
71
+ font-size: 20px;
72
+ text-align: center;
73
+ margin-bottom: 5px;
74
+ }
75
+
76
+ .trustpilot-sidebar-block .rating-empty { float: right; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 -16px; margin-right: 5px; }
77
+ .trustpilot-sidebar-block .rating-star-1 { float: left; display: block; width: 16px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
78
+ .trustpilot-sidebar-block .rating-star-2 { float: left; display: block; width: 32px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
79
+ .trustpilot-sidebar-block .rating-star-3 { float: left; display: block; width: 48px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
80
+ .trustpilot-sidebar-block .rating-star-4 { float: left; display: block; width: 64px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
81
+ .trustpilot-sidebar-block .rating-star-5 { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
82
+
83
+ /** big review stars **/
84
+ .block-content p.company-name { text-align: center; margin: 5px auto; font-size: 11px; }
85
+ .total-block-text { border-bottom: 1px solid #ccc; padding-bottom: 5px; }
86
+ .total-block-text p { text-align: center; padding-top: 5px; margin-bottom: 2px; font-size: 18px; }
87
+ .total-block-text p.based-on { text-align: center; padding-top: 0px; font-size: 11px; font-style: italic; }
88
+
89
+
90
+ /** Original TRUSTPILOT sidebar **/
91
+ .truspilotbox {
92
+ margin-bottom: 10px;
93
+ padding-right: 3px;
94
+ }
95
+ .truspilotbox p:first-letter, .truspilotbox h3:first-letter {
96
+ text-transform: capitalize;
97
+ }
98
+
99
+ .truspilotbox p.r-l,p.r-s, .truspilotbox a#footer span.logo {
100
+ background:url(//s.trustpilot.com/images/tpelements/trustpilotbox/sprite.png) no-repeat;
101
+ }
102
+
103
+ .truspilotbox p.r-l { display:inline-block; width:113px; height:21px; }
104
+ .truspilotbox p.r-s { display:inline-block; width:64px; height:12px; float:left; }
105
+ .truspilotbox p.l-s0 { background-position:-2px -2px; }
106
+ .truspilotbox p.l-s1 { background-position:-2px -27px; }
107
+ .truspilotbox p.l-s2 { background-position:-2px -52px; }
108
+ .truspilotbox p.l-s3 { background-position:-2px -77px; }
109
+ .truspilotbox p.l-s4 { background-position:-2px -102px; }
110
+ .truspilotbox p.l-s5 { background-position:-2px -127px; }
111
+ .truspilotbox p.s-s0 { background-position:-2px -151px; }
112
+ .truspilotbox p.s-s1 { background-position:-2px -166px; }
113
+ .truspilotbox p.s-s2 { background-position:-2px -181px; }
114
+ .truspilotbox p.s-s3 { background-position:-2px -196px; }
115
+ .truspilotbox p.s-s4 { background-position:-2px -211px; }
116
+ .truspilotbox p.s-s5 { background-position:-2px -226px; }
117
+
118
+ .truspilotbox p {
119
+ line-height: 125%;
120
+ color: #444;
121
+ }
122
+
123
+ .truspilotbox .tp-box {
124
+ background:#FFFFFF;
125
+ border:1px solid #444444;
126
+ -webkit-border-top-left-radius: 5px;
127
+ -moz-border-radius-topleft: 5px;
128
+ border-radius-top-left: 5px;
129
+ -webkit-border-top-right-radius: 5px;
130
+ -moz-border-radius-topright: 5px;
131
+ border-radius-top-right: 5px;
132
+ -webkit-border-bottom-right-radius: 5px;
133
+ -moz-border-radius-bottomright: 5px;
134
+ border-radius-bottom-right: 5px;
135
+ -webkit-border-bottom-left-radius: 5px;
136
+ -moz-border-radius-bottomleft: 5px;
137
+ border-radius-bottom-left: 5px;
138
+ display:block;
139
+ position:relative;
140
+ width: 100%;
141
+ overflow: hidden;
142
+ }
143
+
144
+ .truspilotbox .tp-box:hover{
145
+ cursor:pointer;
146
+ }
147
+
148
+ .truspilotbox header {
149
+ -webkit-border-top-left-radius: 5px;
150
+ -moz-border-radius-topleft: 5px;
151
+ border-radius-top-left: 5px;
152
+ -webkit-border-top-right-radius: 5px;
153
+ -moz-border-radius-topright: 5px;
154
+ border-radius-top-right: 5px;
155
+ text-align:center;
156
+ padding: 10px 10px 12px;
157
+ display:block;
158
+ }
159
+
160
+ .truspilotbox header h1 {
161
+ text-align:center;
162
+ font-size: 23px;
163
+ font-family: 'Helvetica Neue', Arial, sans-serif;
164
+ color: #444444;
165
+ font-weight: bold;
166
+ text-transform: none;
167
+ }
168
+
169
+ .truspilotbox div.stars {
170
+ margin:5px 0 0;
171
+ text-align:center;
172
+ }
173
+
174
+ .truspilotbox header p.review-count {
175
+ margin: 7px 0 0;
176
+ text-align:center;
177
+ font-size: 11px;
178
+ padding: 0 10px;
179
+ }
180
+
181
+ .truspilotbox h2#header-reviews {
182
+ background:#DDDDDD;
183
+ font-size:1.273em;
184
+ font-weight:700;
185
+ color:#444444;
186
+ padding:5px 10px;
187
+ }
188
+
189
+
190
+ .truspilotbox section.reviews {
191
+ height:none;
192
+ display:block;
193
+ overflow-y:auto;
194
+ margin:0 ;
195
+ padding:10px 10px 0;
196
+ }
197
+
198
+
199
+ .truspilotbox section.reviews article {
200
+ display:block;
201
+ border-bottom:1px solid #DDDDDD;
202
+ margin:0 0 12px;
203
+ padding:0 0 12px;
204
+ float:left;
205
+ width:100%;
206
+ *width:auto;
207
+ text-align: left;
208
+ }
209
+
210
+ .truspilotbox section.reviews article a {
211
+ color:#CE5600;
212
+ }
213
+
214
+ .truspilotbox section.reviews article.last-child {
215
+ border-bottom: none;
216
+ }
217
+
218
+ .truspilotbox time {
219
+ display:inline-block;
220
+ float:right;
221
+ -moz-opacity:0.6;
222
+ opacity:0.6;
223
+ margin-top:-2px;
224
+ font-family: 'Helvetica Neue', Arial, sans-serif;
225
+ font-size: 11px;
226
+ }
227
+
228
+ .truspilotbox h3 {
229
+ clear:both;
230
+ color:#444444;
231
+ font-size: 12px;
232
+ font-weight:700;
233
+ padding:6px 0 0;
234
+ *padding:0;
235
+ font-family: 'Helvetica Neue', Arial, sans-serif;
236
+ text-transform: none;
237
+ }
238
+
239
+ .truspilotbox p.desc {
240
+ padding:0 0 8px;
241
+ font-size: 11px;
242
+ font-family: 'Helvetica Neue', Arial, sans-serif;
243
+ text-align: left;
244
+ }
245
+
246
+ .truspilotbox img.user-img {
247
+ float:left;
248
+ padding:0 6px 0 0;
249
+ }
250
+
251
+ .truspilotbox p.author {
252
+ font-style:italic;
253
+ font-family: 'Helvetica Neue', Arial, sans-serif;
254
+ font-size: 12px;
255
+ margin-top: 5px;
256
+ color: #444;
257
+ }
258
+
259
+ .truspilotbox a#footer {
260
+ background:#DDDDDD;
261
+ display:block;
262
+ -webkit-border-bottom-right-radius: 5px;
263
+ -moz-border-radius-bottomright: 5px;
264
+ border-radius-bottom-right: 5px;
265
+
266
+ -webkit-border-bottom-left-radius: 5px;
267
+ -moz-border-radius-bottomleft: 5px;
268
+ border-radius-bottom-left: 5px;
269
+ font-size:11px;
270
+ font-weight:700;
271
+ width:100%;
272
+ padding:0 0 4px;
273
+ text-transform:uppercase;
274
+ text-decoration:none;
275
+ }
276
+
277
+ .truspilotbox a#footer span {
278
+ display:inline-block;
279
+ margin:5px 0 0;
280
+ font-size:11px;
281
+ line-height:12px;
282
+ }
283
+
284
+ .truspilotbox a#footer span.trust, .truspilotbox a#footer span.pilot{
285
+ position:relative;top:-1px;
286
+ *top:2px;
287
+ _top:-1px;
288
+ }
289
+
290
+ .truspilotbox a#footer span.trust {
291
+ color:#000;
292
+ margin:0 0 0 4px;
293
+ }
294
+
295
+ .truspilotbox a#footer span.pilot {
296
+ color:#444;
297
+ }
298
+
299
+ .truspilotbox a#footer span.logo {
300
+ background-position: -2px -265px;
301
+ height:12px; width:12px;
302
+ margin:6px 0 0 10px;
303
+ }
304
+
305
+ .truspilotbox div.clear {
306
+ clear:both;
307
+ font-size:1px;
308
+ height:20px;
309
+ }
skin/frontend/base/default/magmodules/trustpilot/style.css ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu - http://www.magmodules.eu - info@magmodules.eu
3
+ * =============================================================
4
+ * NOTICE OF LICENSE [Single domain license]
5
+ * This source file is subject to the EULA that is
6
+ * available through the world-wide-web at:
7
+ * http://www.magmodules.eu/license-agreement/
8
+ * =============================================================
9
+ * @category Magmodules
10
+ * @package Magmodules_Shopreview
11
+ * @author Magmodules <info@magmodules.eu>
12
+ * @copyright Copyright (c) 2013 (http://www.magmodules.eu)
13
+ * @license http://www.magmodules.eu/license-agreement/
14
+ * =============================================================
15
+ */
16
+
17
+ .trustpilot {
18
+ }
19
+
20
+ .trustpilot h1 {
21
+ float: left;
22
+ width: 50%;
23
+ }
24
+
25
+ .trustpilot .button {
26
+ float: right;
27
+ }
28
+
29
+ .trustpilot .about-trustpilot {
30
+ float: left;
31
+ width: 70%;
32
+ }
33
+
34
+ .trustpilot .stats-trustpilot {
35
+ float: right;
36
+ width: 30%;
37
+ text-align: center;
38
+ }
39
+
40
+ .trustpilot .ratingblock-trustpilot {
41
+ width: 60px;
42
+ height: 60px;
43
+ padding: 4px 0px 0px 3px;
44
+ font-weight: bold;
45
+ font-size: 13px;
46
+ margin: 6px auto;
47
+ border-radius: 70px;
48
+ border: 4px solid white;
49
+ box-shadow: 1px 1px 3px #CCCCCC;
50
+ }
51
+
52
+ .trustpilot .content-trustpilot {
53
+ overflow: auto;
54
+ width: 100%;
55
+ margin-bottom: 5px;
56
+ }
57
+
58
+ .trustpilot .review-list {
59
+ margin-bottom: 25px;
60
+ margin-top: 10px;
61
+ }
62
+
63
+ .trustpilot .review-list h3 {
64
+ width: 80%;
65
+ float: left;
66
+ }
67
+
68
+ .trustpilot .review-header {
69
+ clear: both;
70
+ border-bottom: 1px solid #e0e0e0;
71
+ width: 100%;
72
+ height: 25px;
73
+ }
74
+
75
+ .trustpilot ul.overall li {
76
+ float: right;
77
+ }
78
+
79
+ .trustpilot ul.summary-index {
80
+ display: table;
81
+ list-style-type: none;
82
+ }
83
+
84
+ .trustpilot ul.summary-index li {
85
+ display: table-cell;
86
+ padding: 5px 5px 5px 10px;
87
+ }
88
+
89
+ .trustpilot ul.summary-index li.head {
90
+ padding: 10px 5px 5px 5px;
91
+ border-bottom:1px dotted #e0e0e0;
92
+ }
93
+
94
+ .trustpilot ul.experience {
95
+ width: 100%;
96
+ padding: 10px;
97
+
98
+ }
99
+
100
+ .trustpilot .rating-name {
101
+ font-weight: bold;
102
+ display: block;
103
+ margin-bottom: 2px;
104
+ }
105
+
106
+ /* INDEX REVIEW LIST */
107
+ .review-list .rating-empty { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 -16px; margin-right: 5px; }
108
+
109
+ .review-list .rating-star-1 { float: left; display: block; width: 16px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
110
+ .review-list .rating-star-2 { float: left; display: block; width: 32px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
111
+ .review-list .rating-star-3 { float: left; display: block; width: 48px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
112
+ .review-list .rating-star-4 { float: left; display: block; width: 64px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
113
+ .review-list .rating-star-5 { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
114
+
115
+ .review-list .rating-greystar-1 { float: left; display: block; width: 16px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
116
+ .review-list .rating-greystar-2 { float: left; display: block; width: 32px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
117
+ .review-list .rating-greystar-3 { float: left; display: block; width: 48px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
118
+ .review-list .rating-greystar-4 { float: left; display: block; width: 64px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
119
+ .review-list .rating-greystar-5 { float: left; display: block; width: 80px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }