RateItCool_ProductReviews - Version 1.0.3

Version Notes

- Change the ean field to gtin

Download this release

Release Info

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


Code changes from version 1.0.2 to 1.0.3

app/code/community/RateItCool/ProductReviews/Block/Order/Item/Renderer/Default.php CHANGED
@@ -18,18 +18,19 @@
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
  {
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 RateItCool
22
+ * @package RateItCool_ProductReviews
23
+ * @author Cool Services GbR <thomas.gravel@rateit.cool>
24
+ * @copyright Copyright (c) 2015 Cool Services GbR (https://www.rateit.cool)
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
 
28
  /**
29
  * Order item render block
30
  *
31
+ * @category RateItCool
32
+ * @package RateItCool_ProductReviews
33
+ * @author Cool Services GbR <thomas.gravel@rateit.cool>
34
  */
35
  class RateItCool_ProductReviews_Block_Order_Item_Renderer_Default extends Mage_Sales_Block_Order_Item_Renderer_Default
36
  {
app/code/community/RateItCool/ProductReviews/Model/Product.php CHANGED
@@ -37,7 +37,7 @@ 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
  {
@@ -58,8 +58,8 @@ class RateItCool_ProductReviews_Model_Product extends Mage_Catalog_Model_Product
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 {
@@ -69,7 +69,7 @@ class RateItCool_ProductReviews_Model_Product extends Mage_Catalog_Model_Product
69
 
70
  public function getGpnType()
71
  {
72
- if ($this->getEan() != NULL) {
73
  return $this->_staticGPNFieldname;
74
  } else {
75
  return $this->_apiUserName;
37
 
38
  protected $_apiUserName = 'demo';
39
  protected $_apiKey = 'password';
40
+ protected $_staticGPNFieldname = 'gtin';
41
 
42
  public function __construct()
43
  {
58
 
59
  public function getGpnValue()
60
  {
61
+ if ($this->getGtin() != NULL) {
62
+ return $this->getGtin();
63
  } else if ($this->getSku() != NULL) {
64
  return $this->getSku();
65
  } else {
69
 
70
  public function getGpnType()
71
  {
72
+ if ($this->getGtin() != NULL) {
73
  return $this->_staticGPNFieldname;
74
  } else {
75
  return $this->_apiUserName;
app/code/community/RateItCool/ProductReviews/Model/Review/Reviews.php CHANGED
@@ -64,6 +64,8 @@ class RateItCool_ProductReviews_Model_Review_Reviews extends Mage_Core_Model_Abs
64
 
65
  curl_setopt($ch, CURLOPT_URL, $url);
66
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
 
 
67
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
68
  $returnElement = array();
69
 
64
 
65
  curl_setopt($ch, CURLOPT_URL, $url);
66
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
67
+ curl_setopt($this->request, CURLOPT_SSL_VERIFYPEER, false);
68
+ curl_setopt($this->request, CURLOPT_SSL_VERIFYHOST, false);
69
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
70
  $returnElement = array();
71
 
app/design/frontend/base/default/template/productreviews/view.phtml CHANGED
@@ -24,7 +24,6 @@
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
27
- <pre>DEFAULT productreviews->view.phtml</pre>
28
  <?php if($this->getProductData()->getId()): ?>
29
  <div class="product-review">
30
  <div class="page-title">
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
 
27
  <?php if($this->getProductData()->getId()): ?>
28
  <div class="product-review">
29
  <div class="page-title">
js/rateitcool/rateit.cool.js CHANGED
@@ -7,6 +7,16 @@ var RateItCoolAPI = (function($){
7
  _jQuery = $,
8
  _oldjQuery = $;
9
 
 
 
 
 
 
 
 
 
 
 
10
  var _ratingsProductList = function () {
11
  var productlistSpans = _jQuery('.rate-it-cool-product');
12
  if (productlistSpans && productlistSpans.length > 0) {
@@ -22,6 +32,10 @@ var RateItCoolAPI = (function($){
22
  if (_jQuery(productlistSpans[ i ]).attr('data-gpnvalue') !== undefined) {
23
  gpnvalue = _jQuery(productlistSpans[ i ]).attr('data-gpnvalue');
24
  if (gpnvalue.length > 0) {
 
 
 
 
25
  if (gpnvalues[gpntype] == undefined) {
26
  gpnvalues[gpntype] = [];
27
  }
7
  _jQuery = $,
8
  _oldjQuery = $;
9
 
10
+ var _zerofilledGtin = function(n,w) {
11
+ if (n.length < 13) {
12
+ var n_ = Math.abs(n);
13
+ var zeros = Math.max(0, w - Math.floor(n_).toString().length );
14
+ var zeroString = Math.pow(10,zeros).toString().substr(1);
15
+ return zeroString+n;
16
+ }
17
+ return n;
18
+ }
19
+
20
  var _ratingsProductList = function () {
21
  var productlistSpans = _jQuery('.rate-it-cool-product');
22
  if (productlistSpans && productlistSpans.length > 0) {
32
  if (_jQuery(productlistSpans[ i ]).attr('data-gpnvalue') !== undefined) {
33
  gpnvalue = _jQuery(productlistSpans[ i ]).attr('data-gpnvalue');
34
  if (gpnvalue.length > 0) {
35
+ if (gpntype !== _username) {
36
+ gpnvalue = _zerofilledGtin(_jQuery(productlistSpans[ i ]).attr('data-gpnvalue'),13);
37
+ _jQuery(productlistSpans[ i ]).attr('data-gpnvalue', gpnvalue);
38
+ }
39
  if (gpnvalues[gpntype] == undefined) {
40
  gpnvalues[gpntype] = [];
41
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RateItCool_ProductReviews</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>MTL</license>
7
  <channel>community</channel>
@@ -23,13 +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>- Add the shop review form&#xD;
27
- - Add the seo feature to the detail page&#xD;
28
- - Add the server api calls</notes>
29
  <authors><author><name>Thomas Gravel</name><user>RateItCoolReviews</user><email>thomas.gravel@rateit.cool</email></author></authors>
30
- <date>2015-09-09</date>
31
- <time>15:56:46</time>
32
- <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="702c625af767f14a85573f3465f6c701"/></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="f8fcf509cd72ff6e38241793390c2327"/></dir><file name="Product.php" hash="1ebd505b405b4db842d81ca7ffc00796"/><dir name="Review"><file name="Reviews.php" hash="98cc9d0286730d62ef0ee09f8fb7dd9f"/></dir><file name="Review.php" hash="5ef8e7ca6a2309efb30eeb0a4aba74a6"/></dir><dir name="etc"><file name="config.xml" hash="472b16ff0be92b95d8aeb48c4f629652"/><file name="system.xml" hash="8b560ce64adfc5248d9c180c3c73b6a8"/></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="ec7228ba4c14a248f243b6a9d278dc78"/></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="e0106966b75513df0573374b225e9d49"/></dir><dir name="de_DE"><file name="RateItCool_ProductReviews.csv" hash="ec21b5e58b4664c33c3e16bb6eaf540b"/></dir></target><target name="mageweb"><dir name="js"><dir name="rateitcool"><file name="rateit.cool.js" hash="867ad0a68c6e2d356c447a2ae68b6d5d"/></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>
33
  <compatible/>
34
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
35
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>RateItCool_ProductReviews</name>
4
+ <version>1.0.3</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>- Change the ean field to gtin&#xD;
27
+ </notes>
 
28
  <authors><author><name>Thomas Gravel</name><user>RateItCoolReviews</user><email>thomas.gravel@rateit.cool</email></author></authors>
29
+ <date>2015-09-25</date>
30
+ <time>10:16:39</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="e81b821b3dc1eb8708cb346654fd7d6a"/></dir></dir></dir><dir name="Product"><dir name="View"><file name="List.php" hash="702c625af767f14a85573f3465f6c701"/></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="f8fcf509cd72ff6e38241793390c2327"/></dir><file name="Product.php" hash="afc49151829b2ba130f2f004b9de2037"/><dir name="Review"><file name="Reviews.php" hash="f80c67b5e082998fd0a00390a597e02e"/></dir><file name="Review.php" hash="5ef8e7ca6a2309efb30eeb0a4aba74a6"/></dir><dir name="etc"><file name="config.xml" hash="472b16ff0be92b95d8aeb48c4f629652"/><file name="system.xml" hash="8b560ce64adfc5248d9c180c3c73b6a8"/></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="ec7228ba4c14a248f243b6a9d278dc78"/></dir></dir><file name="view.phtml" hash="26584f68b240e9b4b497bc09af7704f8"/></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="e0106966b75513df0573374b225e9d49"/></dir><dir name="de_DE"><file name="RateItCool_ProductReviews.csv" hash="ec21b5e58b4664c33c3e16bb6eaf540b"/></dir></target><target name="mageweb"><dir name="js"><dir name="rateitcool"><file name="rateit.cool.js" hash="60740951be3b503e83718fa4b15dd146"/></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>