WordPress at Your Fingertips
function is not described

WC_Order_Item_Product::set_variation() public WC 1.0

Set variation data (stored as meta data - write only).

{} It's a method of the class: WC_Order_Item_Product{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Product = new WC_Order_Item_Product();
$WC_Order_Item_Product->set_variation( $data );
$data(array)
Key/Value pairs.
Default: array()

Code of WC_Order_Item_Product::set_variation() WC 5.6.0

public function set_variation( $data = array() ) {
	if ( is_array( $data ) ) {
		foreach ( $data as $key => $value ) {
			$this->add_meta_data( str_replace( 'attribute_', '', $key ), $value, true );
		}
	}
}