fixes a case were there are orphaned variations and trying to call the parent that doesn't exist

This commit is contained in:
roykho 2015-09-16 08:49:18 -07:00
parent 4c286272af
commit f5f61da4e9
1 changed files with 1 additions and 1 deletions

View File

@ -358,7 +358,7 @@ class WC_Product_Variation extends WC_Product {
public function managing_stock() {
if ( 'yes' === get_option( 'woocommerce_manage_stock', 'yes' ) ) {
if ( 'no' === $this->manage_stock ) {
if ( $this->parent->managing_stock() ) {
if ( $this->parent && $this->parent->managing_stock() ) {
return 'parent';
}
} else {