fixes a case were there are orphaned variations and trying to call the parent that doesn't exist
This commit is contained in:
parent
4c286272af
commit
f5f61da4e9
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue