From 1f0dbd40ffa602ed08b49def7a7d2b989f055e79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Gaillard?=
Date: Tue, 6 Mar 2012 10:47:11 +0000
Subject: [PATCH] [-] MO : #PSFV-622 : BugFix on products comments module
---
.../ProductCommentCriterion.php | 2 +-
.../productcomments/productcomments-extra.tpl | 18 ++++++++++++++----
modules/productcomments/productcomments.css | 6 +++---
modules/productcomments/productcomments.tpl | 2 +-
.../productcomments/products-comparison.tpl | 2 +-
5 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/modules/productcomments/ProductCommentCriterion.php b/modules/productcomments/ProductCommentCriterion.php
index 2d039d0e6..f74b581b9 100644
--- a/modules/productcomments/ProductCommentCriterion.php
+++ b/modules/productcomments/ProductCommentCriterion.php
@@ -155,7 +155,7 @@ class ProductCommentCriterion extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_product` pccp ON (pcc.`id_product_comment_criterion` = pccp.`id_product_comment_criterion` AND pccp.`id_product` = '.(int)$id_product.')
LEFT JOIN `'._DB_PREFIX_.'product_comment_criterion_category` pccc ON (pcc.`id_product_comment_criterion` = pccc.`id_product_comment_criterion`)
LEFT JOIN `'._DB_PREFIX_.'product'.$table.'` '.$alias.' ON ('.$alias.'.id_category_default = pccc.id_category AND '.$alias.'.id_product = '.(int)$id_product.')
- WHERE pccl.`id_lang` = '.(int)($id_lang).' AND (pccp.id_product IS NOT NULL OR p.id_product IS NOT NULL OR pcc.id_product_comment_criterion_type = 1) AND pcc.active = 1
+ WHERE pccl.`id_lang` = '.(int)($id_lang).' AND (pccp.id_product IS NOT NULL OR ps.id_product IS NOT NULL OR pcc.id_product_comment_criterion_type = 1) AND pcc.active = 1
GROUP BY pcc.id_product_comment_criterion');
}
diff --git a/modules/productcomments/productcomments-extra.tpl b/modules/productcomments/productcomments-extra.tpl
index c1125978c..78c5a68be 100644
--- a/modules/productcomments/productcomments-extra.tpl
+++ b/modules/productcomments/productcomments-extra.tpl
@@ -1,4 +1,4 @@
-{*
+ {*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
@@ -86,7 +86,12 @@
data: {action: 'sendComment', secure_key: '{/literal}{$secure_key}{literal}', review: JSON.stringify(datas)},
dataType: "json",
success: function(result){
- $.fancybox.close();
+ if (result == 0) {
+ alert('{/literal}{l s='Your comment can not be posted. Please fill in all required fields.' mod='productcomments'}{literal}');
+ } else {
+ location.reload( true );
+ $.fancybox.close();
+ }
}
});
});
@@ -105,7 +110,12 @@
data: {action: 'sendComment', secure_key: '{/literal}{$secure_key}{literal}', review: JSON.stringify(datas)},
dataType: "json",
success: function(result){
- $.fancybox.close();
+ if (result == 0) {
+ alert('{/literal}{l s='Your comment can not be posted. Please fill in all required fields.' mod='productcomments'}{literal}');
+ } else {
+ location.reload( true );
+ $.fancybox.close();
+ }
}
});
});
@@ -180,7 +190,7 @@
{if $allow_guests == true && $logged == 0}
-
+
{/if}
diff --git a/modules/productcomments/productcomments.css b/modules/productcomments/productcomments.css
index a9680fdc1..cd150335e 100644
--- a/modules/productcomments/productcomments.css
+++ b/modules/productcomments/productcomments.css
@@ -108,14 +108,14 @@
height: 28px;
width: 540px;
border: 1px solid #ccc;
- background: url(../img/bg_input.png) repeat-x scroll 0 0 #fff;
+ background: #fff;
}
#new_comment_form p.textarea textarea {
padding: 0 5px;
height: 80px;
width: 540px;
border: 1px solid #ccc;
- background: url(../img/bg_input.png) repeat-x scroll 0 0 #fff;
+ background: #fff;
}
#new_comment_form .submit {
@@ -133,7 +133,7 @@
border-radius: 3px 3px 3px 3px;
font-weight: bold;
color: #000;
- background: url(../img/bg_bt.gif) repeat-x scroll 0 0 #F4B61B
+ background: url(img/bg_bt.gif) repeat-x scroll 0 0 #F4B61B
}
#new_comment_form .submit .txt_required {
float:left;
diff --git a/modules/productcomments/productcomments.tpl b/modules/productcomments/productcomments.tpl
index 796866a7d..8414fecd6 100644
--- a/modules/productcomments/productcomments.tpl
+++ b/modules/productcomments/productcomments.tpl
@@ -203,7 +203,7 @@
{if $allow_guests == true && $logged == 0}
-
+
{/if}
diff --git a/modules/productcomments/products-comparison.tpl b/modules/productcomments/products-comparison.tpl
index 6713a82cc..ccbc30176 100755
--- a/modules/productcomments/products-comparison.tpl
+++ b/modules/productcomments/products-comparison.tpl
@@ -57,7 +57,7 @@
{foreach from=$grades item=grade key=grade_id}
-
+
{cycle values='comparison_feature_odd,comparison_feature_even' assign='classname'}
|
{$grade}
|