shipping_methods can be null
This commit is contained in:
parent
30c4d3ab77
commit
5329baee0a
|
@ -23,7 +23,7 @@ class WC_Shipping {
|
||||||
/** @var bool True if shipping is enabled. */
|
/** @var bool True if shipping is enabled. */
|
||||||
public $enabled = false;
|
public $enabled = false;
|
||||||
|
|
||||||
/** @var array Stores methods loaded into woocommerce. */
|
/** @var array|null Stores methods loaded into woocommerce. */
|
||||||
public $shipping_methods = null;
|
public $shipping_methods = null;
|
||||||
|
|
||||||
/** @var float Stores the cost of shipping */
|
/** @var float Stores the cost of shipping */
|
||||||
|
@ -162,6 +162,9 @@ class WC_Shipping {
|
||||||
}
|
}
|
||||||
$method = new $method();
|
$method = new $method();
|
||||||
}
|
}
|
||||||
|
if ( is_null( $this->shipping_methods ) ) {
|
||||||
|
$this->shipping_methods = array();
|
||||||
|
}
|
||||||
$this->shipping_methods[ $method->id ] = $method;
|
$this->shipping_methods[ $method->id ] = $method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue