Automattic\WooCommerce\Internal\PushNotifications\Notifications

StockNotification::write_metapublicWC 1.0

{@inheritDoc}

Method of the class: StockNotification{}

No Hooks.

Returns

null. Nothing (null).

Usage

$StockNotification = new StockNotification();
$StockNotification->write_meta( $key ): void;
$key(string) (required)
The meta key.

StockNotification::write_meta() code WC 10.9.1

public function write_meta( string $key ): void {
	$product = WC()->call_function( 'wc_get_product', $this->get_resource_id() );

	if ( $product instanceof WC_Product ) {
		$product->update_meta_data( $key . '_' . $this->event_type, (string) time() );
		$product->save_meta_data();
	}
}