Automattic\WooCommerce\Admin\API\Reports\Coupons

DataStore::sync_on_order_delete()public staticWC 1.0

Clean coupons data when an order is deleted.

{} Это метод класса: DataStore{}

Хуки из метода

Возвращает

null. Ничего.

Использование

$result = DataStore::sync_on_order_delete( $order_id );
$order_id(int) (обязательный)
Order ID.

Код DataStore::sync_on_order_delete() WC 6.9.4

public static function sync_on_order_delete( $order_id ) {
	global $wpdb;

	$wpdb->delete( self::get_db_table_name(), array( 'order_id' => $order_id ) );
	/**
	 * Fires when coupon's reports are removed from database.
	 *
	 * @param int $coupon_id Coupon ID.
	 * @param int $order_id  Order ID.
	 */
	do_action( 'woocommerce_analytics_delete_coupon', 0, $order_id );

	ReportsCache::invalidate();
}