Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Extended Reviews


frankl

Recommended Posts

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

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

  • 10 months later...
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 by radhavallabh
quote
Link to comment
Share on other sites

@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.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

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 by radhavallabh
code
Link to comment
Share on other sites

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 by radhavallabh
SPELL
Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 1 month later...

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 by rubberfashion
Link to comment
Share on other sites

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!');

Link to comment
Share on other sites

  • 3 months later...

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...