• Resolved andynghiem

    (@andynghiem)


    Hello,
    I install plugin Amazon Feed and get this error. How can i fix it ?

    Warning: Invalid argument supplied for foreach() in /home/public_html/wpjoom.com/wp-content/plugins/amazonfeed/html/cache.php on line 37

    My site is https://wpjoom.com
    Thanks for any answer.

Viewing 4 replies - 1 through 4 (of 4 total)
  • the error message usualy means that whatever is supposed to be shown by the foreach loop, is not there (yet).

    maybe start by addding whatever data the plugin needs.

    you could also try and edit the cache.php file, and add a conditional check infront of the foreach;

    general example:
    change the existing (possibly line 37 in your plugin):
    <?php foreach($bananas as $fruit) { ...... } ?>
    to:
    <?php if($bananas) foreach($bananas as $fruit) { ...... } ?>

    Thread Starter andynghiem

    (@andynghiem)

    Thanks alchymyth.
    There my code
    foreach($xml->Items->Item as $item)
    What i need change for ?

    this might work:

    if($xml) foreach($xml->Items->Item as $item)

    or

    if($xml->Items->Item) foreach($xml->Items->Item as $item)

    Thread Starter andynghiem

    (@andynghiem)

    Thanks so much, i my plugin working now.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help about error "Warning: Invalid argument supplied for foreach()"’ is closed to new replies.