Multi-product output failure (ghost product in loop) #9382

Closed
theandystratton opened this Issue Oct 19, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@theandystratton

FILE:
woocommerce/templates/single-product/add-to-cart/grouped.php

WHAT:
the foreach starting at line 24

PROBLEM:
It seems to loop through and sometimes hits a product for which wc_get_product( $product_id ) returns false (I believe this is line 27).

When this happens; we get a fatal error due to the WC_Product::is_in_stock() call, which is not present. I fixed this by editing the plugin and adding the following code at line 27 and bumping the hide out of stock if statement down a few lines:

if ( !$product ) continue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment