RateItCool_ProductReviews - Version 1.0.1

Version Notes

- Add the product review form
- Add locale "de_DE"

Download this release

Release Info

Developer Thomas Gravel
Extension RateItCool_ProductReviews
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/RateItCool/ProductReviews/Block/Helper.php CHANGED
@@ -63,22 +63,12 @@ class RateItCool_ProductReviews_Block_Helper extends Mage_Core_Block_Template
63
 
64
  public function getGpnValue()
65
  {
66
- if ($this->getProduct()->getEan() != NULL) {
67
- return $this->getProduct()->getEan();
68
- } else if ($this->getProduct()->getSku() != NULL) {
69
- return $this->getProduct()->getSku();
70
- } else {
71
- return $this->getProduct()->getId();
72
- }
73
  }
74
 
75
  public function getGpnType()
76
  {
77
- if ($this->getProduct()->getEan() != NULL) {
78
- return 'ean';
79
- } else {
80
- return $this->_apiUserName;
81
- }
82
  }
83
 
84
  public function getReviewsUrl()
@@ -99,7 +89,6 @@ class RateItCool_ProductReviews_Block_Helper extends Mage_Core_Block_Template
99
  */
100
  public function addTemplate($type, $template)
101
  {
102
- Mage::Log('RateItCool addTemplate');
103
  $this->_availableTemplates[$type] = $template;
104
  }
105
  }
63
 
64
  public function getGpnValue()
65
  {
66
+ return $this->getProduct()->getGpnValue();
 
 
 
 
 
 
67
  }
68
 
69
  public function getGpnType()
70
  {
71
+ return $this->getProduct()->getGpnType();
 
 
 
 
72
  }
73
 
74
  public function getReviewsUrl()
89
  */
90
  public function addTemplate($type, $template)
91
  {
 
92
  $this->_availableTemplates[$type] = $template;
93
  }
94
  }
app/code/community/RateItCool/ProductReviews/Block/Order/Item/Renderer/Default.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order item render block
29
+ *
30
+ * @category Mage
31
+ * @package Mage_Sales
32
+ * @author Magento Core Team <core@magentocommerce.com>
33
+ */
34
+ class RateItCool_ProductReviews_Block_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
35
+ {
36
+ public function getName() {
37
+ return 'NBLA';
38
+ }
39
+
40
+ public function getSummaryHtml($product, $templateType, $displayIfNoReviews)
41
+ {
42
+
43
+ die('bla');
44
+ // pick template among available
45
+ if (empty($this->_availableTemplates[$templateType])) {
46
+ $templateType = 'default';
47
+ }
48
+ $this->setTemplate($this->_availableTemplates[$templateType]);
49
+ $this->setProduct($product);
50
+
51
+ return $this->toHtml();
52
+ }
53
+ }
app/code/community/RateItCool/ProductReviews/Block/View.php CHANGED
@@ -41,90 +41,4 @@ class RateItCool_ProductReviews_Block_View extends Mage_Catalog_Block_Product_Ab
41
  $this->setTemplate('productreviews/view.phtml');
42
  }
43
 
44
- /**
45
- * Retrieve current product model from registry
46
- *
47
- * @return Mage_Catalog_Model_Product
48
- */
49
- public function getProductData()
50
- {
51
- return Mage::registry('current_product');
52
- }
53
-
54
- /**
55
- * Retrieve current review model from registry
56
- *
57
- * @return Mage_Review_Model_Review
58
- */
59
- public function getReviewData()
60
- {
61
- return Mage::registry('current_review');
62
- }
63
-
64
- /**
65
- * Prepare link to review list for current product
66
- *
67
- * @return string
68
- */
69
- public function getBackUrl()
70
- {
71
- return Mage::getUrl('*/*/list', array('id' => $this->getProductData()->getId()));
72
- }
73
-
74
- /**
75
- * Retrieve rating summary for current product
76
- *
77
- * @return string
78
- */
79
- public function getGpnType()
80
- {
81
- Mage::Log('getGpnType()');
82
- Mage::Log(var_export($this->getProductData()->getEan(), true));
83
- if( $this->getProductData()->getEan() != NULL ) {
84
- return 'ean';
85
- }
86
- return '';
87
- }
88
-
89
- /**
90
- * Retrieve rating summary for current product
91
- *
92
- * @return string
93
- */
94
- public function getGpnValue()
95
- {
96
- //Mage::Log(var_export($this->getProductData()->getEan()));
97
- // return $this->getProductData()->getEan();
98
- /*
99
- if( !$this->getRatingSummaryCache() ) {
100
- $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getEntitySummary($this->getProductData()->getId()));
101
- }
102
- return $this->getRatingSummaryCache();
103
- */
104
- return '4711';
105
- }
106
-
107
- /**
108
- * Retrieve total review count for current product
109
- *
110
- * @return string
111
- */
112
- public function getTotalReviews()
113
- {
114
- if( !$this->getTotalReviewsCache() ) {
115
- $this->setTotalReviewsCache(Mage::getModel('review/review')->getTotalReviews($this->getProductData()->getId(), false, Mage::app()->getStore()->getId()));
116
- }
117
- return $this->getTotalReviewsCache();
118
- }
119
-
120
- /**
121
- * Format date in long format
122
- *
123
- * @param string $date
124
- * @return string
125
- */
126
- public function dateFormat($date)
127
- {
128
- return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_LONG);
129
- }
130
  }
41
  $this->setTemplate('productreviews/view.phtml');
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
app/code/community/RateItCool/ProductReviews/Model/Order/Item.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Mage
22
+ * @package Mage_Sales
23
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Order Item Model
29
+ *
30
+ *
31
+ * @category Mage
32
+ * @package Mage_Sales
33
+ * @author Magento Core Team <core@magentocommerce.com>
34
+ */
35
+ class RateItCool_ProductReviews_Model_Order_Item extends Mage_Sales_Model_Order_Item
36
+ {
37
+
38
+ public function getSummaryHtml()
39
+ {
40
+ return $this->getProduct()->getGpnValue();
41
+ }
42
+ }
app/code/community/RateItCool/ProductReviews/Model/Product.php CHANGED
@@ -35,6 +35,17 @@
35
  */
36
  class RateItCool_ProductReviews_Model_Product extends Mage_Catalog_Model_Product {
37
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Returns rating summary (always return true)
40
  *
@@ -44,4 +55,24 @@ class RateItCool_ProductReviews_Model_Product extends Mage_Catalog_Model_Product
44
  {
45
  return true;
46
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
35
  */
36
  class RateItCool_ProductReviews_Model_Product extends Mage_Catalog_Model_Product {
37
 
38
+ protected $_apiUserName = 'demo';
39
+ protected $_apiKey = 'password';
40
+ protected $_staticGPNFieldname = 'ean';
41
+
42
+ public function __construct()
43
+ {
44
+ $this->_apiUserName = Mage::getStoreConfig('catalog/RateItCool_ProductReviews/api_user');
45
+ $this->_apiKey = Mage::getStoreConfig('catalog/RateItCool_ProductReviews/api_key');
46
+ parent::__construct();
47
+ }
48
+
49
  /**
50
  * Returns rating summary (always return true)
51
  *
55
  {
56
  return true;
57
  }
58
+
59
+ public function getGpnValue()
60
+ {
61
+ if ($this->getEan() != NULL) {
62
+ return $this->getEan();
63
+ } else if ($this->getSku() != NULL) {
64
+ return $this->getSku();
65
+ } else {
66
+ return $this->getId();
67
+ }
68
+ }
69
+
70
+ public function getGpnType()
71
+ {
72
+ if ($this->getEan() != NULL) {
73
+ return $this->_staticGPNFieldname;
74
+ } else {
75
+ return $this->_apiUserName;
76
+ }
77
+ }
78
  }
app/code/community/RateItCool/ProductReviews/etc/config.xml CHANGED
@@ -14,6 +14,11 @@
14
  <product>RateItCool_ProductReviews_Model_Product</product>
15
  </rewrite>
16
  </catalog>
 
 
 
 
 
17
  </models>
18
  <resources>
19
  <review_setup>
@@ -50,6 +55,15 @@
50
  </args>
51
  </review>
52
  </routers>
 
 
 
 
 
 
 
 
 
53
  </frontend>
54
  <default>
55
  <catalog>
14
  <product>RateItCool_ProductReviews_Model_Product</product>
15
  </rewrite>
16
  </catalog>
17
+ <sales>
18
+ <rewrite>
19
+ <order_item>RateItCool_ProductReviews_Model_Order_Item</order_item>
20
+ </rewrite>
21
+ </sales>
22
  </models>
23
  <resources>
24
  <review_setup>
55
  </args>
56
  </review>
57
  </routers>
58
+ <translate>
59
+ <modules>
60
+ <RateItCool_ProductReviews>
61
+ <files>
62
+ <default>RateItCool_ProductReviews.csv</default>
63
+ </files>
64
+ </RateItCool_ProductReviews>
65
+ </modules>
66
+ </translate>
67
  </frontend>
68
  <default>
69
  <catalog>
app/design/frontend/base/default/layout/productreviews.xml ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Academic Free License (AFL 3.0)
9
+ * that is bundled with this package in the file LICENSE_AFL.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/afl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to license@magento.com so we can send you a copy immediately.
15
+ *
16
+ * DISCLAIMER
17
+ *
18
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
19
+ * versions in the future. If you wish to customize Magento for your
20
+ * needs please refer to http://www.magento.com for more information.
21
+ *
22
+ * @category design
23
+ * @package base_default
24
+ * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <default>
31
+ <reference name="head">
32
+ <action method="addJs"><script>rateitcool/rateit.cool.js</script></action>
33
+ <action method="addCss"><script>rateitcool/rateit.cool.css</script></action>
34
+ <block type="core/template" template="productreviews/metatag.phtml" as="metatag"/>
35
+ </reference>
36
+ <reference name="before_body_end">
37
+ <block type="core/template" template="productreviews/javascript.phtml" as="javascript"/>
38
+ </reference>
39
+ </default>
40
+
41
+ <catalog_product_view>
42
+ <reference name="product.info">
43
+ <block type="review/product_view_list" name="product.reviews" as="productreviews" template="productreviews/product/view/list.phtml" after="additional">
44
+ <action method="addToParentGroup"><group>detailed_info</group></action>
45
+ <action method="setTitle" translate="value"><value>Reviews</value></action>
46
+ </block>
47
+ </reference>
48
+ </catalog_product_view>
49
+
50
+ </layout>
app/design/frontend/base/default/template/productreviews/sales/order/items.phtml ADDED
@@ -0,0 +1 @@
 
1
+ bla
app/locale/de_DE/RateItCool_ProductReviews.csv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Reviews","Gesamtbewertung"
2
+ "Show only reviews with 5 stars","Nur Bewertungen mit 5 Sternen anzeigen"
3
+ "Show only reviews with 4 stars","Nur Bewertungen mit 4 Sternen anzeigen"
4
+ "Show only reviews with 3 stars","Nur Bewertungen mit 3 Sternen anzeigen"
5
+ "Show only reviews with 2 stars","Nur Bewertungen mit 2 Sternen anzeigen"
6
+ "Show only reviews with 1 star","Nur Bewertungen mit 1 Stern anzeigen"
7
+ "Customer recommended this product","Kunden empfehlen das Produkt weiter"
8
+ "Show the latest reviews first","Zeige die neusten Bewertungen zuerst"
9
+ "Show the oldest reviews first","Zeige die ältesten Bewertungen zuerst"
10
+ "Show best reviews first","Zeige die besten Bewertungen zuerst"
11
+ "Show the worst reviews first","Zeige die schlechtesten Bewertungen zuerst"
12
+ "Show the best helpful reviews first","Zeige die hilfreichsten Bewertungen zuerst"
13
+ "Show the worst helpful reviews first","Zeige die nicht hilfreichsten Bewertungen zuerst"
14
+ "Show more reviews...","mehr Bewertungen..."
15
+ "Is the review helpful for you?","War die Bewertung für Sie hilfreich?"
16
+ "Report review?","Melden Sie diese Bewertung"
17
+ "Yes","Ja"
18
+ "No","Nein"
19
+ "Feedback %s report %s","Bewertung %s melden %s"
20
+ "ShowReviews","Zeige Bewertungen"
21
+ "Product review for the product","Bewertung für das Produkt"
22
+ "not really ok","nicht ganz ok"
23
+ "hm ok","ganz ok"
24
+ "ok","ok"
25
+ "cool","cool"
26
+ "coolest","sehr cool"
27
+ "I recommend the product to a friend","I epfehle das Produkt einem Freund"
28
+ "Send the review","Sende die Bewertung"
29
+ "Review the product","Produkt bewerten",
30
+ "Title of the review","Titel der Bewertung"
31
+ "Content of the review","Bewertung als Text"
32
+ "Thank you for the review","Danke für die Bewertung des Produktes"
33
+ "Can't send the review","Konnte die Bewertung leider nicht senden"
app/locale/en_US/RateItCool_ProductReviews.csv CHANGED
@@ -18,3 +18,16 @@
18
  "No","No"
19
  "Feedback %s report %s","Feedback %s report %s"
20
  "ShowReviews","ShowReviews"
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  "No","No"
19
  "Feedback %s report %s","Feedback %s report %s"
20
  "ShowReviews","ShowReviews"
21
+ "Product review for the product","Product review for the product"
22
+ "not really ok","not really ok"
23
+ "hm ok","hm ok"
24
+ "ok","ok"
25
+ "cool","cool"
26
+ "coolest","coolest"
27
+ "I recommend the product to a friend","I recommend the product to a friend"
28
+ "Send the review","Send the review"
29
+ "Review the product","Review the product",
30
+ "Title of the review","Title of the review"
31
+ "Content of the review","Content of the review"
32
+ "Thank you for the review","Thank you for the review"
33
+ "Can't send the review","Can't send the review"
js/rateitcool/rateit.cool.js CHANGED
@@ -34,8 +34,7 @@ var RateItCoolAPI = (function($){
34
  _jQuery.each(gpnvalues, function(gpntype, values) {
35
  if (values.length > 0) {
36
  _jQuery.ajax({
37
- //url : 'https://api.rateit.cool/stars/' + gpntype + '/' + gpnvalues.join(','),
38
- url : 'http://localhost:8080/stars/' + gpntype + '/' + values.join(','),
39
  method: 'GET',
40
  dataType : 'json',
41
  crossDomain: true,
@@ -78,8 +77,7 @@ var RateItCoolAPI = (function($){
78
  var destinationElement = _jQuery(productlistSpans[0]);
79
  if (gpntype && gpnvalue) {
80
  _jQuery.ajax({
81
- // url : 'https://api.rateit.cool/stars/' + gpntype + '/' + gpnvalue,
82
- url : 'http://localhost:8080/stars/' + gpntype + '/' + gpnvalue,
83
  method: 'GET',
84
  dataType : 'json',
85
  crossDomain: true,
@@ -129,8 +127,7 @@ var RateItCoolAPI = (function($){
129
  if (gpntype && gpnvalue && language) {
130
 
131
  _jQuery.ajax({
132
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + '&full=true' + extendedString,
133
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + '&full=true' + extendedString,
134
  method: 'GET',
135
  dataType : 'json',
136
  crossDomain: true,
@@ -224,8 +221,7 @@ var RateItCoolAPI = (function($){
224
  if (gpntype && gpnvalue && language) {
225
 
226
  _jQuery.ajax({
227
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + extendedString,
228
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + extendedString,
229
  method: 'GET',
230
  dataType : 'json',
231
  crossDomain: true,
@@ -280,7 +276,7 @@ var RateItCoolAPI = (function($){
280
  };
281
 
282
  var _registerClickFeedbackSend = function() {
283
- _jQuery('.rateit-cool-send-feedback a').on('click', function(e){
284
  e.preventDefault();
285
  var gpntype = _jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=gpntype]').val(),
286
  gpnvalue = _jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=gpnvalue]').val(),
@@ -292,11 +288,10 @@ var RateItCoolAPI = (function($){
292
  recommend: (_jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=recommend]').is(':checked')?1:0)
293
  },
294
  destinationElement = _jQuery(this);
295
-
296
  if (gpntype && gpnvalue && language && feedbackElement.title !== '' && feedbackElement.content !== '' && feedbackElement.stars > 0) {
297
  _jQuery.ajax({
298
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language,
299
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language,
300
  method: 'POST',
301
  data: JSON.stringify(feedbackElement),
302
  dataType : 'json',
@@ -334,54 +329,59 @@ var RateItCoolAPI = (function($){
334
 
335
  var _fillStarsOnClick = function() {
336
  // fill stars on click
337
- _jQuery('.reviewStars span.value1').on('click', function(e) {
338
  e.preventDefault();
339
- _jQuery(this).parent().find('.star2').removeClass('star2').addClass('star0');
340
- _jQuery(this).removeClass('star0').addClass('star2');
341
- _jQuery(this).parent().find('[name=stars]').val(1);
342
- _jQuery(this).parent().find('.star-text').html(_jQuery(this).attr('title'));
 
343
  });
344
 
345
- _jQuery('.reviewStars span.value2').on('click', function(e) {
346
  e.preventDefault();
347
- _jQuery(this).parent().find('.star2').removeClass('star2').addClass('star0');
348
- _jQuery(this).parent().find('.value1').removeClass('star0').addClass('star2');
349
- _jQuery(this).removeClass('star0').addClass('star2');
350
- _jQuery(this).parent().find('[name=stars]').val(2);
351
- _jQuery(this).parent().find('.star-text').html(_jQuery(this).attr('title'));
 
352
  });
353
 
354
- _jQuery('.reviewStars span.value3').on('click', function(e) {
355
  e.preventDefault();
356
- _jQuery(this).parent().find('.star2').removeClass('star2').addClass('star0');
357
- _jQuery(this).parent().find('.value1').removeClass('star0').addClass('star2');
358
- _jQuery(this).parent().find('.value2').removeClass('star0').addClass('star2');
359
- _jQuery(this).removeClass('star0').addClass('star2');
360
- _jQuery(this).parent().find('[name=stars]').val(3);
361
- _jQuery(this).parent().find('.star-text').html(_jQuery(this).attr('title'));
 
362
  });
363
 
364
- _jQuery('.reviewStars span.value4').on('click', function(e) {
365
  e.preventDefault();
366
- _jQuery(this).parent().find('.star2').removeClass('star2').addClass('star0');
367
- _jQuery(this).parent().find('.value1').removeClass('star0').addClass('star2');
368
- _jQuery(this).parent().find('.value2').removeClass('star0').addClass('star2');
369
- _jQuery(this).parent().find('.value3').removeClass('star0').addClass('star2');
370
- _jQuery(this).removeClass('star0').addClass('star2');
371
- _jQuery(this).parent().find('[name=stars]').val(4);
372
- _jQuery(this).parent().find('.star-text').html(_jQuery(this).attr('title'));
 
373
  });
374
 
375
- _jQuery('.reviewStars span.value5').on('click', function(e) {
376
  e.preventDefault();
377
- _jQuery(this).parent().find('.star2').removeClass('star2').addClass('star0');
378
- _jQuery(this).parent().find('.value1').removeClass('star0').addClass('star2');
379
- _jQuery(this).parent().find('.value2').removeClass('star0').addClass('star2');
380
- _jQuery(this).parent().find('.value3').removeClass('star0').addClass('star2');
381
- _jQuery(this).parent().find('.value4').removeClass('star0').addClass('star2');
382
- _jQuery(this).removeClass('star0').addClass('star2');
383
- _jQuery(this).parent().find('[name=stars]').val(5);
384
- _jQuery(this).parent().find('.star-text').html(_jQuery(this).attr('title'));
 
385
  });
386
  // fill stars on click end
387
  };
@@ -400,8 +400,7 @@ var RateItCoolAPI = (function($){
400
  thisElement.attr('data-positive', (positive+1));
401
  _jQuery(destinationElement).html(positive+1);
402
  _jQuery.ajax({
403
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=positive&id='+feedbackId,
404
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=positive&id='+feedbackId,
405
  method: 'PUT',
406
  dataType : 'json',
407
  crossDomain: true,
@@ -430,8 +429,7 @@ var RateItCoolAPI = (function($){
430
 
431
  if (feedbackId && gpntype && gpnvalue && language) {
432
  _jQuery.ajax({
433
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?incorrect=1&id='+feedbackId,
434
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?incorrect=1&id='+feedbackId,
435
  method: 'PUT',
436
  dataType : 'json',
437
  crossDomain: true,
@@ -447,6 +445,14 @@ var RateItCoolAPI = (function($){
447
  });
448
  };
449
 
 
 
 
 
 
 
 
 
450
  var _sendNotHelpfulOnClick = function() {
451
  _jQuery('.helpful').delegate('.negative', 'click', function(e) {
452
  e.preventDefault();
@@ -463,8 +469,7 @@ var RateItCoolAPI = (function($){
463
 
464
  if (feedbackId && gpntype && gpnvalue && language) {
465
  _jQuery.ajax({
466
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=negative&id='+feedbackId,
467
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=negative&id='+feedbackId,
468
  method: 'PUT',
469
  dataType : 'json',
470
  crossDomain: true,
@@ -520,8 +525,7 @@ var RateItCoolAPI = (function($){
520
  feedbackElements = [];
521
  if (gpntype && gpnvalue && language && count && extraParameter != undefined) {
522
  _jQuery.ajax({
523
- //url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=5&skip=' + count + extraParameter,
524
- url : 'http://localhost:8080/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=5&skip=' + count + extraParameter,
525
  method: 'GET',
526
  dataType : 'json',
527
  crossDomain: true,
@@ -589,6 +593,8 @@ var RateItCoolAPI = (function($){
589
  _showFeedbacksWithStarsOnClick();
590
  _showMoreFeedbacksOnClick();
591
  _sendIncorrectOnClick();
 
 
592
  }
593
 
594
  return {
34
  _jQuery.each(gpnvalues, function(gpntype, values) {
35
  if (values.length > 0) {
36
  _jQuery.ajax({
37
+ url : 'https://api.rateit.cool/stars/' + gpntype + '/' + values.join(','),
 
38
  method: 'GET',
39
  dataType : 'json',
40
  crossDomain: true,
77
  var destinationElement = _jQuery(productlistSpans[0]);
78
  if (gpntype && gpnvalue) {
79
  _jQuery.ajax({
80
+ url : 'https://api.rateit.cool/stars/' + gpntype + '/' + gpnvalue,
 
81
  method: 'GET',
82
  dataType : 'json',
83
  crossDomain: true,
127
  if (gpntype && gpnvalue && language) {
128
 
129
  _jQuery.ajax({
130
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + '&full=true' + extendedString,
 
131
  method: 'GET',
132
  dataType : 'json',
133
  crossDomain: true,
221
  if (gpntype && gpnvalue && language) {
222
 
223
  _jQuery.ajax({
224
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=' + _limit + extendedString,
 
225
  method: 'GET',
226
  dataType : 'json',
227
  crossDomain: true,
276
  };
277
 
278
  var _registerClickFeedbackSend = function() {
279
+ _jQuery('.rateit-cool-send-feedback').delegate('a', 'click', function(e){
280
  e.preventDefault();
281
  var gpntype = _jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=gpntype]').val(),
282
  gpnvalue = _jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=gpnvalue]').val(),
288
  recommend: (_jQuery('form[name=' + _jQuery(this).attr('data-formname') + ']').find('[name=recommend]').is(':checked')?1:0)
289
  },
290
  destinationElement = _jQuery(this);
291
+ console.log(gpntype,gpnvalue, language, feedbackElement);
292
  if (gpntype && gpnvalue && language && feedbackElement.title !== '' && feedbackElement.content !== '' && feedbackElement.stars > 0) {
293
  _jQuery.ajax({
294
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language,
 
295
  method: 'POST',
296
  data: JSON.stringify(feedbackElement),
297
  dataType : 'json',
329
 
330
  var _fillStarsOnClick = function() {
331
  // fill stars on click
332
+ _jQuery('.rate-it-cool-feedback-form').delegate('.oneStars', 'click', function(e) {
333
  e.preventDefault();
334
+ _jQuery(this).parents('form').find('.rate-it-cool-review-summary').attr('style','');
335
+ _jQuery(this).find('.rate-it-cool-review-summary').attr('style','width:100%;');
336
+ _jQuery(this).parents('form').find('.oneStars .rate-it-cool-review-summary').attr('style','width:100%;');
337
+ _jQuery(this).parents('form').find('[name=stars]').val(2);
338
+ _jQuery(this).parents('form').find('.rate-it-cool-star-text').html(_jQuery(this).attr('title'));
339
  });
340
 
341
+ _jQuery('.rate-it-cool-feedback-form').delegate('.twoStars', 'click', function(e) {
342
  e.preventDefault();
343
+ _jQuery(this).parents('form').find('.rate-it-cool-review-summary').attr('style','');
344
+ _jQuery(this).find('.rate-it-cool-review-summary').attr('style','width:100%;');
345
+ _jQuery(this).parents('form').find('.oneStars .rate-it-cool-review-summary').attr('style','width:100%;');
346
+ _jQuery(this).parents('form').find('.twoStars .rate-it-cool-review-summary').attr('style','width:100%;');
347
+ _jQuery(this).parents('form').find('[name=stars]').val(2);
348
+ _jQuery(this).parents('form').find('.rate-it-cool-star-text').html(_jQuery(this).attr('title'));
349
  });
350
 
351
+ _jQuery('.rate-it-cool-feedback-form').delegate('.threeStars', 'click', function(e) {
352
  e.preventDefault();
353
+ _jQuery(this).parents('form').find('.rate-it-cool-review-summary').attr('style','');
354
+ _jQuery(this).find('.rate-it-cool-review-summary').attr('style','width:100%;');
355
+ _jQuery(this).parents('form').find('.oneStars .rate-it-cool-review-summary').attr('style','width:100%;');
356
+ _jQuery(this).parents('form').find('.twoStars .rate-it-cool-review-summary').attr('style','width:100%;');
357
+ _jQuery(this).parents('form').find('.threeStars .rate-it-cool-review-summary').attr('style','width:100%;');
358
+ _jQuery(this).parents('form').find('[name=stars]').val(3);
359
+ _jQuery(this).parents('form').find('.rate-it-cool-star-text').html(_jQuery(this).attr('title'));
360
  });
361
 
362
+ _jQuery('.rate-it-cool-feedback-form').delegate('.fourStars', 'click', function(e) {
363
  e.preventDefault();
364
+ _jQuery(this).parents('form').find('.rate-it-cool-review-summary').attr('style','');
365
+ _jQuery(this).find('.rate-it-cool-review-summary').attr('style','width:100%;');
366
+ _jQuery(this).parents('form').find('.oneStars .rate-it-cool-review-summary').attr('style','width:100%;');
367
+ _jQuery(this).parents('form').find('.twoStars .rate-it-cool-review-summary').attr('style','width:100%;');
368
+ _jQuery(this).parents('form').find('.threeStars .rate-it-cool-review-summary').attr('style','width:100%;');
369
+ _jQuery(this).parents('form').find('.fourStars .rate-it-cool-review-summary').attr('style','width:100%;');
370
+ _jQuery(this).parents('form').find('[name=stars]').val(4);
371
+ _jQuery(this).parents('form').find('.rate-it-cool-star-text').html(_jQuery(this).attr('title'));
372
  });
373
 
374
+ _jQuery('.rate-it-cool-feedback-form').delegate('.fiveStars', 'click', function(e) {
375
  e.preventDefault();
376
+ _jQuery(this).parents('form').find('.rate-it-cool-review-summary').attr('style','');
377
+ _jQuery(this).find('.rate-it-cool-review-summary').attr('style','width:100%;');
378
+ _jQuery(this).parents('form').find('.oneStars .rate-it-cool-review-summary').attr('style','width:100%;');
379
+ _jQuery(this).parents('form').find('.twoStars .rate-it-cool-review-summary').attr('style','width:100%;');
380
+ _jQuery(this).parents('form').find('.threeStars .rate-it-cool-review-summary').attr('style','width:100%;');
381
+ _jQuery(this).parents('form').find('.fourStars .rate-it-cool-review-summary').attr('style','width:100%;');
382
+ _jQuery(this).parents('form').find('.fiveStars .rate-it-cool-review-summary').attr('style','width:100%;');
383
+ _jQuery(this).parents('form').find('[name=stars]').val(5);
384
+ _jQuery(this).parents('form').find('.rate-it-cool-star-text').html(_jQuery(this).attr('title'));
385
  });
386
  // fill stars on click end
387
  };
400
  thisElement.attr('data-positive', (positive+1));
401
  _jQuery(destinationElement).html(positive+1);
402
  _jQuery.ajax({
403
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=positive&id='+feedbackId,
 
404
  method: 'PUT',
405
  dataType : 'json',
406
  crossDomain: true,
429
 
430
  if (feedbackId && gpntype && gpnvalue && language) {
431
  _jQuery.ajax({
432
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?incorrect=1&id='+feedbackId,
 
433
  method: 'PUT',
434
  dataType : 'json',
435
  crossDomain: true,
445
  });
446
  };
447
 
448
+ var _openFeedbackForm = function() {
449
+ _jQuery('.rateit-cool-feedback-from').delegate('a', 'click', function(e) {
450
+ e.preventDefault();
451
+ var feedbackId = _jQuery(this).attr('data-feedbackid');
452
+ _jQuery('#' + feedbackId).toggle('bounce');
453
+ });
454
+ }
455
+
456
  var _sendNotHelpfulOnClick = function() {
457
  _jQuery('.helpful').delegate('.negative', 'click', function(e) {
458
  e.preventDefault();
469
 
470
  if (feedbackId && gpntype && gpnvalue && language) {
471
  _jQuery.ajax({
472
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?helpful=negative&id='+feedbackId,
 
473
  method: 'PUT',
474
  dataType : 'json',
475
  crossDomain: true,
525
  feedbackElements = [];
526
  if (gpntype && gpnvalue && language && count && extraParameter != undefined) {
527
  _jQuery.ajax({
528
+ url : 'https://api.rateit.cool/feedback/' + gpntype + '/' + gpnvalue + '/' + language + '?limit=5&skip=' + count + extraParameter,
 
529
  method: 'GET',
530
  dataType : 'json',
531
  crossDomain: true,
593
  _showFeedbacksWithStarsOnClick();
594
  _showMoreFeedbacksOnClick();
595
  _sendIncorrectOnClick();
596
+
597
+ _openFeedbackForm();
598
  }
599
 
600
  return {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RateItCool_ProductReviews</name>
4
- <version>1.0.0</version>
5
  <stability>stable</stability>
6
  <license>MTL</license>
7
  <channel>community</channel>
@@ -23,11 +23,12 @@ The plugin provides the stars per product&#xD;
23
  Furthermore review texts are displayed on the article detail view. For the collection of product reviews a form is available in the order history. &#xD;
24
  &#xD;
25
  The service the plugin calls is settled on the number of service requests. This number corresponds to the page impressions in the shop for the list of products, the product detail page, and the pages with topseller integration.</description>
26
- <notes>Integration in all product lists</notes>
 
27
  <authors><author><name>Thomas Gravel</name><user>RateItCoolReviews</user><email>thomas.gravel@rateit.cool</email></author></authors>
28
- <date>2015-09-03</date>
29
- <time>13:03:41</time>
30
- <contents><target name="magecommunity"><dir name="RateItCool"><dir name="ProductReviews"><dir name="Block"><file name="Helper.php" hash="abaf66ef406911a81901a518f96990f1"/><dir name="Product"><dir name="View"><file name="List.php" hash="17c1f9e6e6f79d40fdc14fd39b1d24d6"/></dir><file name="View.php" hash="f4dc4a5bcf0ad9ad91639e7181ed0f51"/></dir><file name="View.php" hash="b9f20349b9c0bf07534607b3e28b1020"/></dir><dir name="Helper"><file name="Data.php" hash="2a9f2f7a0eefb8c26c4c4ce3116879cf"/></dir><dir name="Model"><file name="Product.php" hash="618e195b5344dc8c687c8e493dc94634"/></dir><dir name="etc"><file name="config.xml" hash="243f94965b5a8eb808bf33f9137096ea"/><file name="system.xml" hash="f04c9a8051826fa1773a3c95a587bd4f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="productreviews"><dir name="helper"><file name="summary.phtml" hash="bf986ff812fe27a2fe6d75a5d3921518"/><file name="summary_short.phtml" hash="b7cefced1edd907dbe062dea7b5fd727"/></dir><file name="javascript.phtml" hash="3d5a2736bd215769e6c47ff0557b4a44"/><file name="metatag.phtml" hash="8019fb54db1017b4e120423d548230bc"/><dir name="product"><dir name="view"><file name="list.phtml" hash="7dfb5ebad9c7819f025d7e2682d61eb6"/></dir></dir><file name="view.phtml" hash="4651fb9bf0f1bff168be7ce8d2b51ecb"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RateItCool_ProductReviews.xml" hash="2de7f921ef87e18450027a5206d4ed93"/></dir></target><target name="magelocale"><dir name="en_US"><file name="RateItCool_ProductReviews.csv" hash="371a66e4c167ca1d4cee6d943fc02fa8"/></dir></target><target name="mageweb"><dir name="js"><dir name="rateitcool"><file name="rateit.cool.js" hash="dec05d9af1c9ed74ad4a7f967858271d"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="rateitcool"><file name="rateit.cool.css" hash="51aa8f6371c7c7c84fcb774497dc4715"/></dir></dir></dir></dir></target></contents>
31
  <compatible/>
32
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
33
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RateItCool_ProductReviews</name>
4
+ <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>MTL</license>
7
  <channel>community</channel>
23
  Furthermore review texts are displayed on the article detail view. For the collection of product reviews a form is available in the order history. &#xD;
24
  &#xD;
25
  The service the plugin calls is settled on the number of service requests. This number corresponds to the page impressions in the shop for the list of products, the product detail page, and the pages with topseller integration.</description>
26
+ <notes>- Add the product review form&#xD;
27
+ - Add locale "de_DE"</notes>
28
  <authors><author><name>Thomas Gravel</name><user>RateItCoolReviews</user><email>thomas.gravel@rateit.cool</email></author></authors>
29
+ <date>2015-09-07</date>
30
+ <time>14:54:32</time>
31
+ <contents><target name="magecommunity"><dir name="RateItCool"><dir name="ProductReviews"><dir name="Block"><file name="Helper.php" hash="82f94ae20cc04bfafbf5b5064fa8e7dd"/><dir name="Order"><dir name="Item"><dir name="Renderer"><file name="Default.php" hash="ecea759a46f911a28616dca5fb7380a8"/></dir></dir></dir><dir name="Product"><dir name="View"><file name="List.php" hash="17c1f9e6e6f79d40fdc14fd39b1d24d6"/></dir><file name="View.php" hash="f4dc4a5bcf0ad9ad91639e7181ed0f51"/></dir><file name="View.php" hash="ff4654a9860e98d98275d42d5d3c02bd"/></dir><dir name="Helper"><file name="Data.php" hash="2a9f2f7a0eefb8c26c4c4ce3116879cf"/></dir><dir name="Model"><dir name="Order"><file name="Item.php" hash="fa2e4fbfebbe5d13da139d169b959f23"/></dir><file name="Product.php" hash="1ebd505b405b4db842d81ca7ffc00796"/></dir><dir name="etc"><file name="config.xml" hash="577b0de63d060bb1fafe209b914b0cb4"/><file name="system.xml" hash="f04c9a8051826fa1773a3c95a587bd4f"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="productreviews"><dir name="helper"><file name="summary.phtml" hash="bf986ff812fe27a2fe6d75a5d3921518"/><file name="summary_short.phtml" hash="b7cefced1edd907dbe062dea7b5fd727"/></dir><file name="javascript.phtml" hash="3d5a2736bd215769e6c47ff0557b4a44"/><file name="metatag.phtml" hash="8019fb54db1017b4e120423d548230bc"/><dir name="product"><dir name="view"><file name="list.phtml" hash="7dfb5ebad9c7819f025d7e2682d61eb6"/></dir></dir><dir name="sales"><dir name="order"><file name="items.phtml" hash="3cd7a0db76ff9dca48979e24c39b408c"/></dir></dir><file name="view.phtml" hash="4651fb9bf0f1bff168be7ce8d2b51ecb"/></dir></dir><dir name="layout"><file name="productreviews.xml" hash="c86f76a0103dde43f7d156ad5e67dd71"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RateItCool_ProductReviews.xml" hash="2de7f921ef87e18450027a5206d4ed93"/></dir></target><target name="magelocale"><dir name="en_US"><file name="RateItCool_ProductReviews.csv" hash="99993497b7e238c43cf794e3775e6979"/></dir><dir name="de_DE"><file name="RateItCool_ProductReviews.csv" hash="046969d6170e7c290578e4b3ee8c192b"/></dir></target><target name="mageweb"><dir name="js"><dir name="rateitcool"><file name="rateit.cool.js" hash="0d3b8d7c71dbf7a27776e5c672119e23"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="rateitcool"><file name="rateit.cool.css" hash="747697475255ab2c0cff7ab01f43acca"/></dir></dir></dir></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
skin/frontend/base/default/rateitcool/rateit.cool.css CHANGED
@@ -38,3 +38,31 @@
38
  .rate-it-cool-product-feedbacks .date {
39
  float:right;
40
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  .rate-it-cool-product-feedbacks .date {
39
  float:right;
40
  }
41
+
42
+ .box-up-sell .ratings, .cms-index-index .products-grid .ratings, .cms-index-noroute .products-grid .ratings {
43
+ display: block !important;
44
+ }
45
+
46
+ .rate-it-cool-feedback-form .rating-box {
47
+ cursor: pointer;
48
+ }
49
+ .rate-it-cool-feedback-form h2 {
50
+ margin-bottom: 0;
51
+ }
52
+ .rate-it-cool-feedback-form .feedback-title {
53
+ margin-top: 10px;
54
+ }
55
+ .rate-it-cool-feedback-form .feedback-content textarea
56
+ {
57
+ padding: 10px 0 10px 5px;
58
+ width: 99% !important;
59
+ max-width:100%;
60
+ margin: 10px 0;
61
+ border-color: #ccc;
62
+ }
63
+ .rate-it-cool-feedback-form .rate-it-cool-star-text {
64
+ margin-left: 10px;
65
+ }
66
+ .rateit-cool-send-feedback-error {
67
+ color: red;
68
+ }