Author Topic: [BUG + FIX] Top ten on homepage only shows 5 products  (Read 2226 times)

Twix

  • Beginner
  • *
  • Posts: 46
[BUG + FIX] Top ten on homepage only shows 5 products
« on: March 16, 2012, 12:52:32 pm »
Top ten on homepage only shows 5 products, this should be 10 (else call it top 5 products or something...).

File: components/com_virtuemart/views/virtuemart/view.html.php
Line: 90

Bug version:
$products['topten']= $productModel->getProductListing('topten', 5);

Should be:
$products['topten']= $productModel->getProductListing('topten', 10);

Could you please fix this in next version? Would be also nice if the user could select the products in back-end and the name changes from Top 10 to Top [number]. However this has to be translated again and is more work.

Best regards,
Twentronix


Fix attached.

[attachment cleanup by admin]

aayach

  • Beginner
  • *
  • Posts: 3
Re: [BUG + FIX] Top ten on homepage only shows 5 products
« Reply #1 on: March 18, 2012, 02:30:43 am »
HI

I had the same issue with the number of products on the VM home page.

I overwrited the config layout of the template tab to fix that:


I added also the recent products on the home page.

File: components/com_virtuemart/views/virtuemart/view.html.php
From line 79 :
Code: [Select]
if (VmConfig::get('show_featured', 1)) {
$products['featured'] = $productModel->getProductListing('featured', VmConfig::get('show_featured_limit', 5));
$productModel->addImages($products['featured'],1);
}

if (VmConfig::get('show_latest', 1)) {
$products['latest']= $productModel->getProductListing('latest', VmConfig::get('show_latest_limit', 5));
$productModel->addImages($products['latest'],1);
}

if (VmConfig::get('show_topTen', 1)) {
$products['topten']= $productModel->getProductListing('topten', VmConfig::get('show_topten_limit', 5));
$productModel->addImages($products['topten'],1);
}
/**
 * AA : recent products
*/
if (VmConfig::get('show_recent', 1)) {
$products['recent']= $productModel->getProductListing('recent', VmConfig::get('show_recent_limit', 5));
$productModel->addImages($products['recent'],1);
}

hope that helps

-------------------------------
VM 2.0.2 on Joomla 2.5.3



[attachment cleanup by admin]

Twix

  • Beginner
  • *
  • Posts: 46
Re: [BUG + FIX] Top ten on homepage only shows 5 products
« Reply #2 on: March 26, 2012, 15:16:09 pm »
Thanks for your answer, but it needs to be fixed in the core.
VM developers please fix this. Thanks.