WC_Order_Data_Store_CPT::set_recorded_coupon_usage_counts()
Stores information about whether coupon counts were updated.
Method of the class: WC_Order_Data_Store_CPT{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Order_Data_Store_CPT = new WC_Order_Data_Store_CPT(); $WC_Order_Data_Store_CPT->set_recorded_coupon_usage_counts( $order, $set );
- $order(WC_Order|int) (required)
- Order ID or order object.
- $set(true|false) (required)
- True or false.
WC_Order_Data_Store_CPT::set_recorded_coupon_usage_counts() WC Order Data Store CPT::set recorded coupon usage counts code WC 9.4.2
public function set_recorded_coupon_usage_counts( $order, $set ) { if ( $order instanceof WC_Order ) { $order->set_recorded_coupon_usage_counts( $set ); } $order_id = WC_Order_Factory::get_order_id( $order ); update_post_meta( $order_id, '_recorded_coupon_usage_counts', wc_bool_to_string( $set ) ); }