Title: Fatal error in loop
Last modified: November 14, 2019

---

# Fatal error in loop

 *  Resolved [bheadrick](https://wordpress.org/support/users/bheadrick/)
 * (@bheadrick)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-in-loop/)
 * PHP Fatal error: Uncaught TypeError: Argument 1 passed to AEPC_Woocommerce_Addon_Support::
   get_product_id() must be an instance of WC_Product, bool given called in /app/
   public/wp-content/plugins/pixel-caffeine/includes/supports/class-aepc-woocommerce-
   addon-support.php on line 430
 * I’m using “show single variations” by Iconicwp, so this only occurs in loops 
   where the loop item isn’t a product (but a variation)
 * I was able to solve this by simply adding
 *     ```
       	    if(!$product){
       	        return;
               }
       ```
   
 * after
 *     ```
       $product = wc_get_product();
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * (@antoscarface)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-in-loop/#post-12145286)
 * Hi,
 * sorry for the issue and thank you for sharing your solution!
 * I released right now a new version of the plugin that fixes also this issue.
   
   Please, upgrade the version to 2.1.1 in order to have the official fix to this
   issue 🙂
 * Thank you!

Viewing 1 replies (of 1 total)

The topic ‘Fatal error in loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pixel-caffeine_e2ce0c.svg)
 * [Pixel Caffeine](https://wordpress.org/plugins/pixel-caffeine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pixel-caffeine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pixel-caffeine/)
 * [Active Topics](https://wordpress.org/support/plugin/pixel-caffeine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pixel-caffeine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pixel-caffeine/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Antonino Scarfì](https://wordpress.org/support/users/antoscarface/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/fatal-error-in-loop/#post-12145286)
 * Status: resolved