frankl Posted July 28, 2016 Share Posted July 28, 2016 Allows for better, more detailed reviews than stock osCommerce. Suitable for osCommerce 2.34BS Edge. Customers rate your products on whatever criteria you choose (included is Ease of use, Value for money and Quality – these can be changed). There are also fields for Best Feature, Worst Feature and a text box for a review description. Customers can choose a nickname to display on the review. Other customers can up or downvote reviews according to how helpful they are (one vote per IP for each review). On product pages reviews are displayed in the order of highest stars/highest number of upvotes. Reviews need to be approved by admin before going live. Reviews can be edited by admin if necessary. http://addons.oscommerce.com/info/9493 burt, radhavallabh and Moxamint 3 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
radhavallabh Posted June 9, 2017 Share Posted June 9, 2017 (edited) On 28/7/2016 at 8:19 AM, frankl said: Allows for better, more detailed reviews than stock osCommerce. Suitable for osCommerce 2.34BS Edge. Customers rate your products on whatever criteria you choose (included is Ease of use, Value for money and Quality – these can be changed). There are also fields for Best Feature, Worst Feature and a text box for a review description. Customers can choose a nickname to display on the review. Other customers can up or downvote reviews according to how helpful they are (one vote per IP for each review). On product pages reviews are displayed in the order of highest stars/highest number of upvotes. Reviews need to be approved by admin before going live. Reviews can be edited by admin if necessary. http://addons.oscommerce.com/info/9493 Hi; I have added this beautiful addon to my shop but my upvote and down vote do not work. In firefox- error console it gives a ReferenceError: reviewVote is not defined error on detail it says <anonymous> ____________________________ javascript:reviewVote('votesUp',%2054):1:1 Your help and guidance on this would be deeply appreciated; Awaiting your solution Regds/ radhavallabh Edited June 9, 2017 by radhavallabh quote Quote Link to comment Share on other sites More sharing options...
frankl Posted June 9, 2017 Author Share Posted June 9, 2017 I'm not sure why that is, I will check on Tuesday when I'm back at work. Be patient radhavallabh 1 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
frankl Posted June 13, 2017 Author Share Posted June 13, 2017 @radhavallabh I have no idea why that wasn't working for you, tested this end and it was fine. In any case, I've updated the app. It's now easier to install and is more self contained. Uninstall the the previous version by reversing the installation instructions, then download the new version http://addons.oscommerce.com/info/9493 and follow the new installation instructions. Let me know how that goes. Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
radhavallabh Posted June 13, 2017 Share Posted June 13, 2017 2 hours ago, frankl said: @radhavallabh I have no idea why that wasn't working for you, tested this end and it was fine. In any case, I've updated the app. It's now easier to install and is more self contained. Uninstall the the previous version by reversing the installation instructions, then download the new version http://addons.oscommerce.com/info/9493 and follow the new installation instructions. Let me know how that goes. Hi, Thank you I have updated the addon; Please check the upvote and downvote still does not work :( I have pm you the link; Awaiting your earliest response and guidance... Warm Regds/ radhavallabh Quote Link to comment Share on other sites More sharing options...
frankl Posted June 13, 2017 Author Share Posted June 13, 2017 The script on your page is (I have reformatted it for ease of reading): <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); </script> whereas it should be: <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); //alert(data); }else if(vote_action == 'votesDown'){ $("#vDOWN_" + review_id).html(" " + data + " "); $("#vDOWN_" + review_id).show(); //alert(data); } }else{ alert(data); alert("Error in code!"); } //alert(data); }, error: function() { var message = 'Error in ajax!Please try again.'; alert(message); } });//end call ajax } </script> You have somehow cut the end off the javascript function. Fix that and it should work. Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
radhavallabh Posted June 13, 2017 Share Posted June 13, 2017 (edited) 57 minutes ago, frankl said: The script on your page is (I have reformatted it for ease of reading): <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); </script> whereas it should be: <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); //alert(data); }else if(vote_action == 'votesDown'){ $("#vDOWN_" + review_id).html(" " + data + " "); $("#vDOWN_" + review_id).show(); //alert(data); } }else{ alert(data); alert("Error in code!"); } //alert(data); }, error: function() { var message = 'Error in ajax!Please try again.'; alert(message); } });//end call ajax } </script> You have somehow cut the end off the javascript function. Fix that and it should work. Hi, I just updated the code but still no avail.... It seems to cut off all javascript after the if statement within elseif..... I checked the source in Chrome- It shows below function in source- <script>function reviewVote(vote_action,review_id) {var posturl='http://www.xxxxxxxxxx.com/ajax_review_votes.php';var pass_data='action='+vote_action+'&reviews_id='+review_id; $.ajax({url:posturl,data:pass_data,type:'POST',success:function(data){ if(data=='NOTOK'){var message='You are not allowed to send this form!'} else if(data=='already_voted'){var message='Your vote has been already recorded. Thank you!';alert(message)} else if(data==''){var message='Sorry! Please try again.';alert(message)} else if(data.match(/^\d+$/)){ if(vote_action=='votesUp'){$("#vUP_"+review_id).html(" "+data+" ");$("#vUP_"+review_id).show();</script> Please your guidance would be of great help... I fail to understand the issue... Warm Regds. radhavallabh Edited June 13, 2017 by radhavallabh code Quote Link to comment Share on other sites More sharing options...
radhavallabh Posted June 13, 2017 Share Posted June 13, 2017 (edited) 2 hours ago, frankl said: The script on your page is (I have reformatted it for ease of reading): <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); </script> whereas it should be: <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = 'You are not allowed to send this form!'; }else if(data == 'already_voted'){ var message = 'Your vote has been already recorded. Thank you!'; alert(message); }else if(data == ''){ var message = 'Sorry! Please try again.'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); //alert(data); }else if(vote_action == 'votesDown'){ $("#vDOWN_" + review_id).html(" " + data + " "); $("#vDOWN_" + review_id).show(); //alert(data); } }else{ alert(data); alert("Error in code!"); } //alert(data); }, error: function() { var message = 'Error in ajax!Please try again.'; alert(message); } });//end call ajax } </script> You have somehow cut the end off the javascript function. Fix that and it should work. Hi, The Minification script was striping the comments from the javascript... So the fucntion ahead of the script was getting removed. I removed all comments from it. And Voila! it works Great Thank you so much for all your help!!! And also thank you very much for such a wonderful addon.... Very Warm Regards/ radhavallabh Edited June 13, 2017 by radhavallabh SPELL Quote Link to comment Share on other sites More sharing options...
frankl Posted June 13, 2017 Author Share Posted June 13, 2017 Cheers, glad you got it fixed. radhavallabh 1 Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
radhavallabh Posted June 17, 2017 Share Posted June 17, 2017 Hi, I have another query please.. I want to strip the html tags that are displayed on my old reviews. I tried strip_tags () but does not work... Any suggestion please. Awaiting your valuable resolution; Warm Regds/ radhavallabh Quote Link to comment Share on other sites More sharing options...
frankl Posted June 18, 2017 Author Share Posted June 18, 2017 @radhavallabh I'm not sure. Perhaps something to do with your minification script again. I find minification more trouble than it's worth, the savings aren't that great and it screws up a lot of other things. If you want to persist it might be a better idea to run a script on the database entries to remove all the tags. Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
radhavallabh Posted June 18, 2017 Share Posted June 18, 2017 1 hour ago, frankl said: @radhavallabh I'm not sure. Perhaps something to do with your minification script again. I find minification more trouble than it's worth, the savings aren't that great and it screws up a lot of other things. If you want to persist it might be a better idea to run a script on the database entries to remove all the tags. Hi I did as you said, switched off minification and tested it but it still displays the html tags in the text of the testimonial. Seems some other way to remove them has to be used.. Please could you help and guide me do it. Warm Regds/ radhavallabh Quote Link to comment Share on other sites More sharing options...
frankl Posted June 18, 2017 Author Share Posted June 18, 2017 Post the section of code that is giving you problems. Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
rubberfashion Posted August 13, 2017 Share Posted August 13, 2017 (edited) Hello, nice work!! here some changes for better multilanguage support: catalog/review.php and catalog/product_reviews.php: echo '<p style="margin-top:15px;"><span>' . REVIEWS_TEXT_RATED_HELPFUL . ' </span><a href="javascript:reviewVote(\'votesUp\', '.$reviews['reviews_id'].')" class="btn btn-default"><span class="fa fa-thumbs-up fa-lg"></span><span class="numUpDv" id="vUP_'.$reviews['reviews_id'].'" '.$upvotes_num_style.'> '.$r_upvotes.' </span> '. REVIEWS_TEXT_RATED_THANK .' '.$reviews_name.'</a> <a href="javascript:reviewVote(\'votesDown\','.$reviews['reviews_id'].')" class="btn btn-default"><span class="fa fa-thumbs-down fa-lg"></span><span class="numUpDv" id="vDOWN_'.$reviews['reviews_id'].'" '.$downvotes_num_style.'> '.$r_downvotes.' </span></a></p>'; <script> function reviewVote(vote_action, review_id){ var posturl = '<?php echo tep_href_link('ajax_review_votes.php','',$request_type);?>'; var pass_data = 'action=' + vote_action + '&reviews_id=' + review_id; $.ajax({ url: posturl, data: pass_data, type: 'POST', success: function(data) { if(data == 'NOTOK'){ var message = '<?php echo REVIEWS_TEXT_RATED_NOTALLOWEDSEND;?>'; }else if(data == 'already_voted'){ var message = '<?php echo REVIEWS_TEXT_RATED_ALREADYVOTED;?>'; alert(message); }else if(data == ''){ var message = '<?php echo REVIEWS_TEXT_RATED_TRYAGAIN;?>'; alert(message); }else if(data.match(/^\d+$/)){ if(vote_action == 'votesUp'){ $("#vUP_" + review_id).html(" " + data + " "); $("#vUP_" + review_id).show(); //alert(data); }else if(vote_action == 'votesDown'){ $("#vDOWN_" + review_id).html(" " + data + " "); $("#vDOWN_" + review_id).show(); //alert(data); } }else{ alert(data); alert("<?php echo REVIEWS_TEXT_RATED_ERRORINCODE;?>"); } //alert(data); }, error: function() { var message = '<?php echo REVIEWS_TEXT_RATED_ERRORAJAX;?>'; alert(message); } });//end call ajax } </script> ADD: \catalog\includes\languages\german\reviews.php and product_reviews.php : define('REVIEWS_TEXT_RATED_HELPFUL','War diese Bewertung hilfreich?'); define('REVIEWS_TEXT_RATED_THANK','Danke'); define('REVIEWS_TEXT_RATED_NOTALLOWEDSEND','Sie dürfen dieses Formular nicht senden!'); define('REVIEWS_TEXT_RATED_ALREADYVOTED','Ihre Stimme wurde bereits erfasst. Vielen Dank!'); define('REVIEWS_TEXT_RATED_TRYAGAIN','Es tut uns leid! Bitte versuche es erneut.'); define('REVIEWS_TEXT_RATED_ERRORINCODE','Fehler im Code!'); define('REVIEWS_TEXT_RATED_ERRORAJAX','Fehler bei ajax! Bitte versuchen Sie es erneut.'); \catalog\includes\languages\english\reviews.php and product_reviews.php : define('REVIEWS_TEXT_RATED_HELPFUL','Was this review helpful?'); define('REVIEWS_TEXT_RATED_THANK','Thank'); define('REVIEWS_TEXT_RATED_NOTALLOWEDSEND','You are not allowed to send this form!'); define('REVIEWS_TEXT_RATED_ALREADYVOTED','Your vote has been already recorded. Thank you!'); define('REVIEWS_TEXT_RATED_TRYAGAIN','Sorry! Please try again.'); define('REVIEWS_TEXT_RATED_ERRORINCODE','Error in code!'); define('REVIEWS_TEXT_RATED_ERRORAJAX','Error in ajax!Please try again.'); Edited August 13, 2017 by rubberfashion Quote Link to comment Share on other sites More sharing options...
rubberfashion Posted August 13, 2017 Share Posted August 13, 2017 Also change: catalog\includes\modules\content\product_info\cm_pi_extended_reviews.php: } else { $review_data .= '<div>'. REVIEWS_TEXT_RATED_LETKNOW .'</div>'; } ob_start(); include('includes/modules/content/' . $this->group . '/templates/extended_reviews.php'); Also update catalog\includes\languages\english\modules\content\product_info\cm_pi_extended_reviews.php define('REVIEWS_TEXT_RATED_LETKNOW','Let other customers know about this product.'); Also update catalog\includes\languages\german\modules\content\product_info\cm_pi_extended_reviews.php define('REVIEWS_TEXT_RATED_LETKNOW','Teilen sie Ihre Erfahrungen über dieses Produkt mit anderen!'); frankl 1 Quote Link to comment Share on other sites More sharing options...
frankl Posted August 13, 2017 Author Share Posted August 13, 2017 Thank you! Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
dreumel Posted November 22, 2017 Share Posted November 22, 2017 I would like to change the sentence in: define('REVIEWS_TEXT_RATED_LETKNOW','Let other customers know about this product.'); as you mentioned in 'catalog\includes\languages\english\modules\content\product_info\cm_pi_extended_reviews.php I can not find it in that file. Can you help me out? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.