Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    help question Help receiving: Warning: Invalid argument supplied for foreach()

    Could someone help me with this problem concerning customer checkout?

    If I buy something on my site and go through the checkout process, after the process is almost over, where it reaches step 3 of 3 and I click on confirm your order, it comes to this page. I have no clue what's wrong. thanks in advance for any help!

    Warning
    : Invalid argument supplied for foreach() in /home/**my username**/public_html/tenniscoachnyc/includes/classes/order.php on line 712

    Warning: Cannot modify header information - headers already sent by (output started at /home/bumbl4/public_html/tenniscoachnyc/includes/classes/order.php:712) in /home/ **my username**/public_html/tenniscoachnyc/includes/functions/functions_general.php on line 44

    I can list my site and set up a test account if that would help. Thanks!!

  2. #2
    Join Date
    Dec 2006
    Location
    Seligman, MO U.S.A.
    Posts
    2,101
    Plugin Contributions
    5

    Default Re: Help receiving: Warning: Invalid argument supplied for foreach()

    what does your line 44 look like in your functions_general.php?
    Teach them to shop and they will shop today;
    Teach them to Zen and they will OWN a shop tomorrow!

  3. #3
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    help question Re: Help receiving: Warning: Invalid argument supplied for foreach()

    Hi Get Em,

    thanks for your message. Here is line 44 in functions_general.php (in my included/functions folder)

    header('Location: ' . $url);

    Let me know if I should show you anything else. thanks and thanks!

    ko

  4. #4
    Join Date
    Dec 2006
    Location
    Seligman, MO U.S.A.
    Posts
    2,101
    Plugin Contributions
    5

    Default Re: Help receiving: Warning: Invalid argument supplied for foreach()

    Well, I'm no php expert, but I think it might have something to do with the "Best Sellers List" (help me out DrByte!). Do you have this turned on? If so, try turning it off, and try your checkout process, again to see if it still gives you the error.

    Where, I'm getting this is, your first argument:
    Warning: Invalid argument supplied for foreach() in /home/**my username**/public_html/tenniscoachnyc/includes/classes/order.php on line 712
    which, on my order.php, line 712 is blank, but that whole section has to do with calling the "Best Sellers List".
    Teach them to shop and they will shop today;
    Teach them to Zen and they will OWN a shop tomorrow!

  5. #5
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    help question Re: Help receiving: Warning: Invalid argument supplied for foreach()

    Hi Get em,

    Thanks for your reply.

    My column box of "best sellers" is already turned off. So I tried turning "best sellers off" by going to configuration>layout settings
    Bestsellers - truncate product names to "false". That still didn't work. The rest of the bestseller settings were at their default.

    Do you know if it would work if I compared an original order file to the current one and tried matching some things up? I'm not a coder so I don't know...just a thought.

    Or any other ideas? Thanks in advance for any thoughts!

    ko

  6. #6
    Join Date
    Dec 2006
    Location
    Seligman, MO U.S.A.
    Posts
    2,101
    Plugin Contributions
    5

    Default Re: Help receiving: Warning: Invalid argument supplied for foreach()

    Well, kat, i don't know, either, as i posted earlier,I'm no php expert (by a LONG shot), but sometimes, I've noticed, that if you stare at that error message long enough, and check each of the files mentioned, the answer just pops out. But, sometimes, as with this case, it isn't there, and that's where the fun begins.
    So, now, I'm just as lost as you. Sorry. Maybe Linda or DrByte will pick up on this post pretty soon. Those 2 have ALL the answers...........plumb smart-assey, ain't they?
    Teach them to shop and they will shop today;
    Teach them to Zen and they will OWN a shop tomorrow!

  7. #7
    Join Date
    Dec 2006
    Location
    Seligman, MO U.S.A.
    Posts
    2,101
    Plugin Contributions
    5

    Default Re: Help receiving: Warning: Invalid argument supplied for foreach()

    What's your URL, anyway?, or is this not a live site, yet?
    Teach them to shop and they will shop today;
    Teach them to Zen and they will OWN a shop tomorrow!

  8. #8
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    help question Re: Help receiving: Warning: Invalid argument supplied for foreach()

    I looked at the file and line 712 looks like this

    // ZMB -- Decrement stock for all attributes ordered
    foreach ( $this->products[$i]['attributes'] as $attribute ) {
    $products_options_values_id = $attribute['value_id'];
    $stock_left = $attribute['quantity'] - $this->products[$i]['qty'];
    $db->Execute( "update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_quantity = '" . $stock_left . "' WHERE products_options_values_id = '" . $products_options_values_id . "'" );
    }

    }
    }

    so maybe it has something to do with my attributes.

    Also even though it goes to this screen, the order comes through to my end.

    thanks for any one's thoughts!

    ko

  9. #9
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    Default Re: Help receiving: Warning: Invalid argument supplied for foreach()


  10. #10
    Join Date
    Apr 2007
    Posts
    8
    Plugin Contributions
    0

    help question Re: Help receiving: Warning: Invalid argument supplied for foreach()

    True...well I'll keep staring. Thanks for all your help Getem!

 

 

Similar Threads

  1. Replies: 1
    Last Post: 3 Jul 2013, 04:00 AM
  2. Replies: 7
    Last Post: 4 Jan 2013, 09:21 PM
  3. Debug: USPS.php PHP Warning: Invalid argument supplied for foreach()
    By divinelighting in forum Addon Shipping Modules
    Replies: 2
    Last Post: 11 Jun 2011, 03:17 AM
  4. Warning: Invalid argument supplied for foreach
    By harlyman in forum General Questions
    Replies: 9
    Last Post: 23 Aug 2006, 11:39 AM
  5. Replies: 7
    Last Post: 31 Jul 2006, 04:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR