WC_Order_Item_Product::set_product_id( int $value )

Set Product ID


Description Description


Parameters Parameters

$value

(Required) Product ID.


Top ↑

Source Source

File: includes/class-wc-order-item-product.php

	public function set_product_id( $value ) {
		if ( $value > 0 && 'product' !== get_post_type( absint( $value ) ) ) {
			$this->error( 'order_item_product_invalid_product_id', __( 'Invalid product ID', 'woocommerce' ) );
		}
		$this->set_prop( 'product_id', absint( $value ) );
	}


Top ↑

User Contributed Notes User Contributed Notes

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