Permalink
Browse files

Ensure grouped product exists

Fixes #9382
  • Loading branch information...
mikejolley committed Oct 22, 2015
1 parent b3a3a99 commit 002bfa45e4274b86a5de60504a2567ca2f06f0ae
Showing with 3 additions and 1 deletion.
  1. +3 −1 templates/single-product/add-to-cart/grouped.php
@@ -30,7 +30,9 @@
<tbody>
<?php
foreach ( $grouped_products as $product_id ) :
- $product = wc_get_product( $product_id );
+ if ( ! $product = wc_get_product( $product_id ) ) {
+ continue;
+ }
if ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $product->is_in_stock() ) {
continue;

1 comment on commit 002bfa4

@theandystratton

This comment has been minimized.

Show comment
Hide comment

Thank you!

Please sign in to comment.