Fix for #8691: Variation without parent will not cause 500.
This commit is contained in:
parent
09145181e5
commit
f4db67bcbc
|
@ -156,7 +156,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
}
|
||||
|
||||
// add the parent product data to an individual variation
|
||||
if ( $product->is_type( 'variation' ) ) {
|
||||
if ( $product->is_type( 'variation' ) && $product->parent ) {
|
||||
|
||||
$product_data['parent'] = $this->get_product_data( $product->parent );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue