Automattic\WooCommerce\Internal\StockNotifications
Notification::set_product_id
Set the product ID.
Method of the class: Notification{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Notification = new Notification(); $Notification->set_product_id( $product_id );
- $product_id(int) (required)
- Product ID.
Notification::set_product_id() Notification::set product id code WC 10.3.6
public function set_product_id( int $product_id ) {
// Reset runtime cache if the product ID has changed.
if ( is_a( $this->product, 'WC_Product' ) && $product_id !== $this->product->get_id() ) {
$this->product = null;
}
$this->set_prop( 'product_id', $product_id );
}