VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Raidu on August 18, 2011, 10:10:09 AM

Title: Division by zero in <- Problem. Need a solution!
Post by: Raidu on August 18, 2011, 10:10:09 AM
Hello,

I'm working on a e-shop for my client, but the VirtueMart is giving me a hard time. I am running on 1.7 joomla and the problem is:

COM_VIRTUEMART_MEDIA_NO_PATH_TYPE <- I have set the paths to media via config, but it still is giving me this error.

Warning: Division by zero in components/com_virtuemart/views/categories/tmpl/default.php on line 32 <- I have no idea how to fix this one

and this one:

Warning: Division by zero in components/com_virtuemart/views/categories/tmpl/default.php on line 54

The code lines are under here:

Line 30. // Calculating Categories Per Row
31. $categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
32. $category_cellwidth = ' width'.floor ( 100 / $categories_per_row );

Line 53. // Show the vertical seperator
54.   if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
55.      $show_vertical_separator = ' ';
56.   } else {
57.      $show_vertical_separator = $verticalseparator;
58.   }

Please help me out! I need a fix asap.
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: PRO on August 18, 2011, 15:44:23 PM
what do you have for "Default number of categories in a row" ??? in your config?




Title: Re: Division by zero in <- Problem. Need a solution!
Post by: Minh BlackRed on August 23, 2011, 06:00:51 AM
I think that his config values are cleared!
You can get it up by log in to VM admin -> Menu Tools > Update > Restore System Defaults
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: Milbo on August 24, 2011, 01:47:14 AM
Quote from: lamvt on August 23, 2011, 11:01:15 AM
Pls check your http://joomquery.com/administrator/components/com_virtuemart/install/virtuemart_defaults.cfg
And Make it writeable (CHMOD 755 or 777)

This is very interesting. The file shouldnt needed to be writeable, only readable. Further tests would be nice.
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: lamvt on August 24, 2011, 08:59:52 AM
Sory for my Bad english but I have sugession:
Line 30:
// Calculating Categories Per Row
$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );

Replace to:
// Calculating Categories Per Row
$categories_per_row = trim(VmConfig::get ( 'categories_per_row', 3 ));
if (($categories_per_row!=""))&&(!is_int($categories_per_row)){
$categories_per_row ==3;
}

** EDIT: please respect the forum and community and do not advertise in posts **
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: Milbo on August 24, 2011, 21:43:36 PM
the bug is that VmConfig should do that already internally.
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: kbrookes on August 25, 2011, 06:19:46 AM
Quote from: lamvt on August 23, 2011, 11:01:15 AM
I have same problem,I soved it
Pls check your http://joomquery.com/administrator/components/com_virtuemart/install/virtuemart_defaults.cfg
And Make it writeable (CHMOD 755 or 777)
Go to backent http://joomquery.com/administrator/index.php?option=com_virtuemart&view=config Click Save or Save and close button.
now Open your Fontent: http://joomquery.com/virtuemart_shop
you will see results
GOODLUCK

This doesn't work for me. I've tried a variety of categories-per-row values, but that doesn't help either.
Title: Re: Division by zero in <- Problem. Need a solution!
Post by: Milbo on August 25, 2011, 11:06:36 AM
Please try the version in svn. Use "renew config by file" and it should work then.