WC_Product::set_weight( float|string $weight )

Set the product’s weight.


Description Description


Parameters Parameters

$weight

(float|string) (Required) Total weight.


Top ↑

Source Source

File: includes/abstracts/abstract-wc-product.php

	public function set_weight( $weight ) {
		$this->set_prop( 'weight', '' === $weight ? '' : wc_format_decimal( $weight ) );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.