News:

Support the VirtueMart project and become a member

Main Menu

bug in vm2.0.8a

Started by JerryQ, July 02, 2012, 17:30:07 PM

Previous topic - Next topic

JerryQ

I just updated my vm2.0.8 to 2.0.8a.
when i open my product category in the frontend, it shows:

Warning: Division by zero in E:\xampp\htdocs\dongjia\administrator\components\com_virtuemart\models\product.php on line 516

and i found the code as it said in product.php:
$rest = $suglimit%$category->products_per_row;

it seems the "$category->products_per_row" return zero.

so i modified this line into:

if($category->products_per_row>0){
   $rest = $suglimit%$category->products_per_row;
}else{
   $rest =1;}


and finally it worked.

operapixie

THANK you, this solution worked for me, but I did run into a small error because of missed syntax pertaining to exactly what was supposed to be replaced.  In case it helps anyone else,

Find this code:
$rest = $suglimit%$category->products_per_row;
$limit = $suglimit - $rest;

}


Replace it with this code:
if($category->products_per_row>0){
$rest = $suglimit%$category->products_per_row;
}else{
$rest =1;}
}

Milbo

Already fixed in the b version, please use this one
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/