Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::set_recorded_coupon_usage_counts()publicWC 1.0

Stores information about whether coupon counts were updated.

Метод класса: OrdersTableDataStore{}

No Hooks.

Return

null. Nothing.

Usage

$OrdersTableDataStore = new OrdersTableDataStore();
$OrdersTableDataStore->set_recorded_coupon_usage_counts( $order, $set );
$order(\WC_Order) (required)
Order object.
$set(true|false) (required)
True or false.

Code of OrdersTableDataStore::set_recorded_coupon_usage_counts() WC 7.1.0

public function set_recorded_coupon_usage_counts( $order, $set ) {
	if ( is_int( $order ) ) {
		$order = wc_get_order( $order );
	}
	$order->set_recorded_coupon_usage_counts( $set );
	$order->save();
}