VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: micah411 on May 30, 2014, 05:58:33 AM

Title: Error: Warning: Invalid argument supplied for foreach()
Post by: micah411 on May 30, 2014, 05:58:33 AM
Just an introduction, I'm pretty much a novice. I'm pretty good with basic coding (html, css, javascript) but chose to use virtuamart because thats about where my experience ends.

I'm running into an error on my site http://rmartinplumbing.net/home/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=15&Itemid=444 (http://rmartinplumbing.net/home/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=15&Itemid=444). The error is: Warning: Invalid argument supplied for foreach() in /home/content/52/12128552/html/home/templates/theme494/html/com_virtuemart/productdetails/default_addtocart2.php on line 44

Does anyone know how to fix this from the front end (joomla) without going directly into the code? If not, does anyone have specific instructions on how to correct this?

Thanks in advance!
Micah
Title: Re: Error: Warning: Invalid argument supplied for foreach()
Post by: GJC Web Design on May 30, 2014, 09:04:05 AM
It's not an error - it's a warning - in an ideal world it wouldn't be there but it does no harm
it is just your reporting set too high either in joomla or the server

but:
1. there is no such file as default_addtocart2.php in std VM so it is in your template - ask the template supplier

2. simple fix  - add

error_reporting(E_ERROR);

as the first php line in that file
Title: Re: Error: Warning: Invalid argument supplied for foreach()
Post by: Milbo on June 03, 2014, 15:09:15 PM
/default_addtocart2 ?