Jump to content

Warning: Invalid Argument


Guest 7Design

Recommended Posts

Guest 7Design

When I add an item to the cart, I get the following error:

"Warning: Invalid argument supplied for foreach() in /home/public_html/store1/includes/content/cart.inc.php on line 346"

Any help on this?

I'm going insane. I have to install 2 of these carts, and I can't even get one going completely.

7Design

Link to comment
Share on other sites

Guest sunshine

Look in the includes folder->content->cart.inc.

on line 346, does the line look precisely like this?

foreach($basket['conts'] as $key => $value){

Link to comment
Share on other sites

Guest 7Design

Look in the includes folder->content->cart.inc.

on line 346, does the line look precisely like this?

foreach($basket['conts'] as $key => $value){

Yes. Exactly. But, since I did have the cart working before, I believe when uploading all files this time around, my ftp client must have caused a problem.

I can't think of any other issue that would cause this.

7Design

Link to comment
Share on other sites

  • 5 months later...

Hi I have the same problem today when I moved host.

Anyone have an idea why this is happening?

Look in the includes folder->content->cart.inc.

on line 346, does the line look precisely like this?

foreach($basket['conts'] as $key => $value){

Yes. Exactly. But, since I did have the cart working before, I believe when uploading all files this time around, my ftp client must have caused a problem.

I can't think of any other issue that would cause this.

7Design

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
Guest PMinteractive

I just started having this error and really couldn't figure it out at first, it didn't make sense. You usually get this error when you pass a 'foreach' statement something other than the array it was expecting to cycle through, and is a sign of something failing to populate an array further up the code.

I also couldn't add stuff to the cart and I know this is tracked by cookies. I had recently upgraded to Opera 9 (talk about a step backwards...) and its been a bit odd with cookies and the like.

So anyway, I found that deleting all cookies for the site (and clearing the cache for good measure) fixed all the problems I was having by magic.

Try it in a browser you haven't used before, or on someone elses computer to see if the problem still exists.

Good luck guys

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...