News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

VM 2.0.12f Pagination Problems, different number of items on each page

Started by NorxMAL, October 31, 2012, 22:04:24 PM

Previous topic - Next topic

NorxMAL

Virtuemart 2.0.12f
Joomla 1.7.5

Site http://www.greenapple.no/index.php?option=com_virtuemart&view=category&virtuemart_category_id=0&Itemid=174

Pagination is set as 10,20,30,50,100,500

But the pagination pages can show 3 products, 3 products, 5 products, 1 product for each page for example when the list is set to 10.

I have tried all different variations of both joomla sef and virtuemart sef on and off combinations.
I have uninstalled Virtuemart and installed it again, importing the products and images through CSVI, that is why it looks like a mess now.

Any ideas please? :)

NorxMAL

I have figured out that this happens when I select
Configuration->Configuration::Shopfront->Action when a Product is Out of Stock

and Do not Display Product is selected it may show 4 products on page 1, 2 on page 2 etc.
But if I select Products Out of Stock are orderable, no special action for example, it shows 10 products for each page, as the previous choice just weeds out the lacking 6 products on page 1, and 8 on page 2.

But no matter what I put in the
Configuration->Configuration::Templates->Shopfront Settings->Set the pagination sequence for the List Box
It will always show 10 products, no matter if you choose 500 as my first pagination.

NorxMAL

As a temporarily solution, I'm making it list all my products, setting it at 500 in the file
administrator/components/com_virtuemart/models/product.php

line 552 from $suglimit = $category->limit_list_initial; to this code $suglimit = 500;

Original Code Section

$catModel= VmModel::getModel('category');
$category = $catModel->getCategory();
if(empty($limit)){
if(!empty($category->limit_list_initial)){
$suglimit = $category->limit_list_initial;
} else {
if(empty($category->limit_list_step)){
$suglimit = VmConfig::get ('list_limit', 20);
} else {
$suglimit = $category->limit_list_step;
}
}
if(empty($category->products_per_row)){
$category->products_per_row = VmConfig::get ('products_per_row', 3);
}
$rest = $suglimit%$category->products_per_row;
$limit = $suglimit - $rest;
}


Modified

$catModel= VmModel::getModel('category');
$category = $catModel->getCategory();
if(empty($limit)){
if(!empty($category->limit_list_initial)){
$suglimit = 500;
} else {
if(empty($category->limit_list_step)){
$suglimit = VmConfig::get ('list_limit', 20);
} else {
$suglimit = $category->limit_list_step;
}
}
if(empty($category->products_per_row)){
$category->products_per_row = VmConfig::get ('products_per_row', 3);
}
$rest = $suglimit%$category->products_per_row;
$limit = $suglimit - $rest;
}


Edit : Forgot to add ; after 500 in the Modified code