Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2004
    Posts
    118
    Plugin Contributions
    0

    Default Warning: Invalid argument supplied for foreach

    hi

    i got this problem after a new install today, this error shows up when a user log in at there user account to edit details, any ideas??


    Warning: Invalid argument supplied for foreach() in /home/1/s/user/includes/templates/user/templates/tpl_account_default.php on line 37

  2. #2
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Warning: Invalid argument supplied for foreach

    Quote Originally Posted by harlyman
    hi

    i got this problem after a new install today, this error shows up when a user log in at there user account to edit details, any ideas??


    Warning: Invalid argument supplied for foreach() in /home/1/s/user/includes/templates/user/templates/tpl_account_default.php on line 37
    What do you have at line 37?
    -------
    <?php
    foreach($ordersArray as $orders) {
    ?>
    ----

    ??
    Also. is it customised template?

  3. #3
    Join Date
    Jan 2004
    Posts
    118
    Plugin Contributions
    0

    Default Re: Warning: Invalid argument supplied for foreach

    Quote Originally Posted by superprg
    What do you have at line 37?
    -------
    <?php
    foreach($ordersArray as $orders) {
    ?>
    ----

    ??
    Also. is it customised template?

    i have at line 37

    <?php
    foreach($ordersArray as $orders) {
    ?>

    and yes i have customised my template but only stylesheets, have not changed anything in the code..

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Warning: Invalid argument supplied for foreach

    You are using an old version. A bug related to that was fixed in a more recent release.

    As of today, the latest is v1.3.0.2
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    118
    Plugin Contributions
    0

    Default Re: Warning: Invalid argument supplied for foreach

    Quote Originally Posted by DrByte
    You are using an old version. A bug related to that was fixed in a more recent release.

    As of today, the latest is v1.3.0.2
    i do use v1.3.0.2, a fresh install from a fresh tar ball:)

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Warning: Invalid argument supplied for foreach

    Then you've made an error when customizing the page
    /includes/templates/user/templates/tpl_account_default.php

    or maybe that file has come from a template you obtained from someone else?

    If you switch back to classic, or delete that file, does the problem persist?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Warning: Invalid argument supplied for foreach

    Quote Originally Posted by harlyman
    i do use v1.3.0.2, a fresh install from a fresh tar ball:)
    I am guessing when you said tar ball you were referring to that loosely as Zen Cart is in a Zip format ...

    Otherwise, where did you get it as a tar ball?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Warning: Invalid argument supplied for foreach

    I'm gonna take that back.

    While I can't reproduce what you're describing on a fresh v1.3.0.2 install here, there is an error related to what you're describing, which has been fixed for the next release.

    /includes/modules/pages/account/header_php.php
    around line 48, you have:
    PHP Code:
    $orders $db->Execute($orders_query);

    while (!
    orders->EOF) { 
    Between those two lines, add this:
    PHP Code:
    $ordersArray=array(); 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: Warning: Invalid argument supplied for foreach

    I had the same problem, I applied the fix and it works.

    The problem appeared when I made second test order to one of my dummy account (with group pricing on). Not sure the real culprit though.

    Thanks Dr Byte.

  10. #10
    Join Date
    Jun 2006
    Posts
    33
    Plugin Contributions
    0

    Default Re: Warning: Invalid argument supplied for foreach

    got this problem also and apply that line and it works

 

 

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. Help receiving: Warning: Invalid argument supplied for foreach()
    By kateoeight in forum General Questions
    Replies: 9
    Last Post: 1 May 2007, 09:28 PM
  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