News:

Looking for documentation? Take a look on our wiki

Main Menu

Max reviews displayed per product limited in frontend

Started by lindapowers, February 27, 2016, 14:18:59 PM

Previous topic - Next topic

lindapowers

Hello

Where does VirtueMart limit the reviews to 10 displayed???

We have products with many more reviews in the backend but the frontend only shows 10 and I have no clue where the limit comes from.

Is this limited by the core? in what file please?

Regards

VM 3.0.12 joomla 3.4.8

Jörgen

Hello

I found this in the templates/hera_j3_vm3/html/com_virtuemart/productdetails/default_reviews.php

$ratingsShow = VmConfig::get( 'vm_num_ratings_show', 3 ); // TODO add  vm_num_ratings_show in vmConfig


Try to add vm_num_ratings_show in vmconfig. In this case default seems to be three.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

lindapowers

#2
Quote from: Jörgen on February 27, 2016, 14:33:46 PM
Hello

I found this in the templates/hera_j3_vm3/html/com_virtuemart/productdetails/default_reviews.php

$ratingsShow = VmConfig::get( 'vm_num_ratings_show', 3 ); // TODO add  vm_num_ratings_show in vmConfig


Try to add vm_num_ratings_show in vmconfig. In this case default seems to be three.

regards

Jörgen @ Kreativ Fotografi

Thanks, Im looking at same file, and already changed:

$showall = vRequest::getBool( 'showall', FALSE );
to
$showall = vRequest::getBool( 'showall', TRUE );


Which directly removes the initial limit of 3 and gest rid of the "more reviews" link, I tried changing the number of the code you suggested but doesn't seem to affect in the global number of reviews shown.

I tested in default beez template and it limits reviews displayed to 10 also so seems to come directly from VM... but where?

Regards

Jörgen

Hello

You are correct, I can´t see any limitation in the template file. I checked the model that load the ratings:
administrator/components/com_virtuemart/models/ratings.php

But I can´t say that I can see any limitation there either. Are You sure You have more than 10 published reviews ?

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

lindapowers

Yes, take a look

http://www.comenaranjas.com/en/shop/oranges/table-oranges-kg-detail.html

And another one

http://www.comenaranjas.com/en/shop/oranges/juice-oranges-kg-detail.html

In the backend I have nearly 30 reviews for one of them and like 20 for the other one.

A bit strange that both show exactly 10 no?

I even checked in the database table for vm config but don't see any limit there either.

Regards

Jörgen

Hello again

This is strange, I have now added new entries into the database, duplicating an already entered review and I can see a total of 11 entries. Don´t see any limit of 10. You have no other thing affecting this. I noticed the review module. Is it possible this is interfering with Your other reviews ? Try unpublishing this module and test again. Don´t forget to clear cache.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

lindapowers

Thanks, I tried unpublishing the module but without effect.

I can't think of anything that could affect the max reviews shown per product... an X-file seems, if you tell me you can show more than 10.

Strange thing is that rich snippets in google actually read all the reviews but in the page only 10 are displayed per product max hmmmm.

Regards

GJC Web Design

the ratings query uses the stock vm query function

$this->exeSortSearchListQuery(0,' r.*,pr.`product_name` ',$tables,$whereString,'',$this->_getOrdering());

the last parameter isn't passed

public function exeSortSearchListQuery($object, $select, $joinedTables, $whereString = '', $groupBy = '', $orderBy = '', $filter_order_Dir = '', $nbrReturnProducts = false )

so it takes it from your pagination setting

if($nbrReturnProducts){
         $limitStart = 0;
         $limit = $nbrReturnProducts;
         $this->_withCount = false;
      } else if($this->_noLimit){
         $this->_withCount = false;
         $limitStart = 0;
         $limit = 0;
      } else {
         $limits = $this->setPaginationLimits();
         $limitStart = $limits[0];
         $limit = $limits[1];

      }

assume that's 20?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

lindapowers

Hi GJC

Thanks! You found it, we had 10 set in frontend default items per view



Increasing that number increases the reviews shown,

Regards

GJC Web Design

I guess a separate config would be nice for this.....

in config

vm_num_ratings_show=xx

components\com_virtuemart\views\productdetails\view.html.php ~ line 234

$this->rating_reviews = $ratingModel->getReviews($product->virtuemart_product_id, 0, VmConfig::get( 'vm_num_ratings_show', 10));


administrator\components\com_virtuemart\models\ratings.php ~ 144

function getReviews($virtuemart_product_id, $virtuemart_vendor_id = 0, $num_ratings){

administrator\components\com_virtuemart\models\ratings.php ~ 168

$reviews[$hash] = $this->exeSortSearchListQuery(0,$select,$tables,$whereString,'',$this->_getOrdering(), $num_ratings);
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

#10
Thank you,

added VmConfig::get( 'vm_num_ratings_show', 3 ) to getReviews function
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

#11
Quote from: Milbo on February 27, 2016, 22:34:25 PM
Thank you,

added VmConfig::get( 'vm_num_ratings_show', 3 ) to getReviews function

Hello I just installed 3.0.14 but I can't find an option in the backend to set the max reviews shown.

Is there a new setting for this somwhere?

Regards

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lindapowers

Quote from: Milbo on March 14, 2016, 01:49:06 AM
is a hidden one atm

Thanks, I tried to add:

vm_num_ratings_show=xx

In virtuemart.cfg but didnt work for me,

Regards

Studio 42