WordPress at Your Fingertips
function is not described

WC_Order_Item_Product::set_variation_id() public WC 1.0

Set variation ID.

{} 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_id( $value );
$value(int) (required)
Variation ID.

Code of WC_Order_Item_Product::set_variation_id() WC 5.6.0

public function set_variation_id( $value ) {
	if ( $value > 0 && 'product_variation' !== get_post_type( $value ) ) {
		$this->error( 'order_item_product_invalid_variation_id', __( 'Invalid variation ID', 'woocommerce' ) );
	}
	$this->set_prop( 'variation_id', absint( $value ) );
}