Author Topic: Division by zero in <- Problem. Need a solution!  (Read 7425 times)

Raidu

  • Beginner
  • *
  • Posts: 1
Division by zero in <- Problem. Need a solution!
« 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.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10319
  • VirtueMart Version: 3+
Re: Division by zero in <- Problem. Need a solution!
« Reply #1 on: August 18, 2011, 15:44:23 pm »
what do you have for "Default number of categories in a row" ??? in your config?




J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

I do NOT do development work for hire.

Minh BlackRed

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 22
  • VirtueMart Version: 2
Re: Division by zero in <- Problem. Need a solution!
« Reply #2 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
VM Responsive
shop.littledevil-tuning.com

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9800
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Division by zero in <- Problem. Need a solution!
« Reply #3 on: August 24, 2011, 01:47:14 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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lamvt

  • 3rd party VirtueMart Developer
  • Beginner
  • *
  • Posts: 30
  • http://joomquery.com Make website like loving kids
    • joomquery - joomla like loving kids
  • Skype Name: thanhlam19792003
Re: Division by zero in <- Problem. Need a solution!
« Reply #4 on: August 24, 2011, 08:59:52 am »
Sory for my Bad english but I have sugession:
Line 30:
Code: [Select]
// Calculating Categories Per Row
$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
Replace to:
Code: [Select]
// 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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9800
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Division by zero in <- Problem. Need a solution!
« Reply #5 on: August 24, 2011, 21:43:36 pm »
the bug is that VmConfig should do that already internally.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

kbrookes

  • Beginner
  • *
  • Posts: 26
    • thinksync
Re: Division by zero in <- Problem. Need a solution!
« Reply #6 on: August 25, 2011, 06:19:46 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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9800
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Division by zero in <- Problem. Need a solution!
« Reply #7 on: August 25, 2011, 11:06:36 am »
Please try the version in svn. Use "renew config by file" and it should work then.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/