WC_Product_Variable::child_has_weight
Does a child have a weight set?
Method of the class: WC_Product_Variable{}
No Hooks.
Returns
true|false.
Usage
$WC_Product_Variable = new WC_Product_Variable(); $WC_Product_Variable->child_has_weight();
WC_Product_Variable::child_has_weight() WC Product Variable::child has weight code WC 10.6.2
public function child_has_weight() {
$transient_name = 'wc_child_has_weight_' . $this->get_id();
$has_weight = get_transient( $transient_name );
if ( false === $has_weight ) {
$has_weight = $this->data_store->child_has_weight( $this );
set_transient( $transient_name, (int) $has_weight, DAY_IN_SECONDS * 30 );
}
return (bool) $has_weight;
}