Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: How to remove Rating Stars from Review tab  (Read 5353 times)

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
How to remove Rating Stars from Review tab
« on: July 08, 2017, 06:46:16 PM »
I want to use the written Review system, without the Rating Stars. 

I removed the displayed Star rating from the Product page via style.css
Code: [Select]
.productprice .rate {display: none;}
Next step: 

I need to stop the form validation (empty field error test) for the Rating field, then remove the name & field from a tpl file, or just style it with display-none in css.

I researched these 2 threads:
http://forum.abantecart.com/index.php/topic,417.msg1260.html#msg1260
http://forum.abantecart.com/index.php/topic,3558.msg15849.html#msg15849

They are not fully relevant to the current AC version.   

I tried editing this file: admin/controller/pages/catalog/review.php.
I commented out lines 409-411, then cleared cache and tested. 

It didn't work.  When i submitted a review without a Star Rating, i still got the "Error Please select a review rating!" message.

Am I editing the wrong file, or making the wrong edit? 

Would appreciate any suggestions!
« Last Edit: July 09, 2017, 06:26:12 PM by Geoffrey »

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Rating Stars from Review tab
« Reply #1 on: July 09, 2017, 09:50:33 PM »
OK, I figured it out.

Assuming you are customizing a template clone extension, removing the Star Rating system from AbanteCart while keeping the written Review system requires 1 core edit plus 3 extension edits:

1 - (Core edit) - go to sitename/storefront/controller/responses/product/review.php.  Comment out lines 121-123:
Code: [Select]
// if (!$this->request->post['rating']) {
// $this->error['message'] = $this->language->get('error_rating');
// }
This halts the validation process for the Star Rating element of the Product Review system.  If it is no longer validated, it is no longer required to be displayed. 

2 - In sitename/extensions/mytemplate/storefront/view/mytempate/template/pages/product/product.tpl - comment out lines 340-345:
      [code[<!-- <div class="form-inline">
         <label class="control-label col-md-3 pull-left"><?php echo $entry_rating; ?>
         <span
            class="red">*</span></label>
         <?php echo $rating_element; ?>
      </div> -->[/code]
The removes the Star Rating element from the Product Review element under the Review tab on the Product page. 

3 - add to style.css :
Code: [Select]
#current_reviews.mb20 .content img {display: none;}This hides the individual Star rating displayed next to the name of each prior reviewer. 

4 - add to style.css:
Code: [Select]
.productprice .rate {display: none;}This hides the Stars that are displayed on the product page.

PS - if you want to remove the | character that is displayed after the reviewer Name: delete it from line 3 of your template/responses/product/review.tpl. 

This is my thinking:
The star ratings system includes a numerical calculation of the average of Star Ratings for each product, with the resultant display of the calculated numerical average rating, in terms of stars, on each Product page.  On a new site with no ratings of any product, there are no errors associated with the absence of ratings on which to perform the calculations.  If a site admin removes the coded validation for the required Product Review Star Rating element, the system will not generate an error if the customer does not select a star rating.  If the site admin then removes or hides all Star Rating entry points on the front end, there will never be any Star Rating values entered by a customer.  In this sense, the site will remain in a perpetually 'new" state with no Rating data, which should mean that the Average Star Rating calculation system will not lead to future errors.  As such, no other editing of core files should be necessary to disable the Star Rating system.  All you need to do is make some edits in your template extension to remove displayed elements of the Star Rating system. 

If I missed anything crucial, hopefully an AC staff member will jump in to tell me how my site will eventually break. 

Thx. 

PPS - steps 3 and 4 may not be essential.  I don't have time to go back and test, but theoretically, there is no need to hide an item that will never be displayed because of the step 2 removal of the entry point for that item's source data.

« Last Edit: July 09, 2017, 11:48:54 PM by Geoffrey »

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Rating Stars from Review tab
« Reply #2 on: July 09, 2017, 09:53:33 PM »
One more comment: if you go looking for core edits, start looking in /storefront/controller/... first. 

I spent a lot of time poking around in /admin/controller/... without effect. 

The storefront folder is the place to start. 

Thx.

Offline Geoffrey

  • Full Member
  • ***
  • Posts: 153
  • Karma: +28/-3
    • View Profile
Re: How to remove Rating Stars from Review tab
« Reply #3 on: July 09, 2017, 11:46:15 PM »
LOL. 

My site is done.  My two core edits were the last thing i did: Stars and PayPal icon.   

I was just testing the product review stuff and I got an error when I added a fake review using the admin backend. 

Then it hit me!  Like a flash!

The root storefront folder is for the front end.

The root admin folder is for the back end! 

Yes!  I get that now.  Brilliant!

It's crazy being a noob with AbanteCart.  It's crazy just being a noob.

So if you read my 1st post above, the lines 409-411 in that admin-folder file are the ones that you need to comment out or delete in order to halt the validation of the Star Rating input for the backend.  You may need to do this if you get an error while trying to approve customer ratings. 

Whew. 
« Last Edit: July 10, 2017, 12:15:50 AM by Geoffrey »

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5798
  • Karma: +274/-2
    • View Profile
Re: How to remove Rating Stars from Review tab
« Reply #4 on: July 10, 2017, 02:31:02 AM »
Thanks for sharing

 

Powered by SMFPacks Social Login Mod