WC_Product::set_weight( float|string $weight )
Set the product’s weight.
Description Description
Parameters Parameters
- $weight
-
(Required) Total weight.
Source Source
File: includes/abstracts/abstract-wc-product.php
public function set_weight( $weight ) {
$this->set_prop( 'weight', '' === $weight ? '' : wc_format_decimal( $weight ) );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |