News:

Looking for documentation? Take a look on our wiki

Main Menu

Division by zero in <- Problem. Need a solution!

Started by Raidu, August 18, 2011, 10:10:09 AM

Previous topic - Next topic

Raidu

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.

PRO

what do you have for "Default number of categories in a row" ??? in your config?





Minh BlackRed

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
VM Responsive
shop.littledevil-tuning.com

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lamvt

#4
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 **
joomquery - Make website like loving Kids: http://joomquery.com

Milbo

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

kbrookes

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.
Kelsey
thinksync

Milbo

Please try the version in svn. Use "renew config by file" and it should work then.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/