• Hi

    I get this error in php error log, I have not upgraded the plugin or done nothing with the installation, the error did just started a couple of days ago

    PHP Warning: Invalid argument supplied for foreach() in /home/xcsd/wp-content/plugins/yith-woocommerce-wishlist/includes/class.yith-wcwl.php on line 177

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi Visionitse

    I just checked plugin code, but I cannot find any foreach on line 177 of class.yith-wcwl.php
    Are you using latest plugin version?

    Regarding the error itself, the closest foreach is a cycle that loop over wishlist items inside user cookies

    Maybe the problem is related to a corrupted cookie in one of your customers browser
    I suggest you to start emptying your browser navigation data; in this way we will exclude your own cookies

    If the problem persists, could you please attach me the content of line 177 of your class.yith-wcwl.php file?

    Maybe I can add an additional check before the foreach ??

    Please, let me know
    Have a nice day
    Giuseppe

    Version 2.0.16

    I’m getting this error in the log as well. Here’s line 177 in class.yith-wcwl.php

     foreach( $wishlist as $key => $item ){
                        if( $item['wishlist_id'] == $wishlist_id && $item['prod_id'] == $product_id ){
                            $exists = true;
                        }
                    }

    Any ideas appreciated, thanks

    Plugin Author YITHEMES

    (@yithemes)

    Hi mickyharris

    I’m sorry for the issue; I will add a new check over $wishlist variable in next plugin revision
    In the meantime, could you please try to change class.yith-wcwl.php file as follows?

    
    if( $wishlist && is_array( $wishlist ) ){
      foreach( $wishlist as $key => $item ){
        if( $item['wishlist_id'] == $wishlist_id && $item['prod_id'] == $product_id ){
          $exists = true;
        }
      }
    }
    

    Please, let me know
    Have a nice day

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error class.yith-wcwl.php on line 177’ is closed to new replies.