WordPress at Your Fingertips
function is not described

WC_Order_Data_Store_CPT::get_coupon_held_keys_for_users() public WC 1.0

Return array of coupon_code => meta_key for coupon which have usage limit per customer and have tentative keys.

{} It's a method of the class: WC_Order_Data_Store_CPT{}

No Hooks.




$WC_Order_Data_Store_CPT = new WC_Order_Data_Store_CPT();
$WC_Order_Data_Store_CPT->get_coupon_held_keys_for_users( $order, $coupon_id );
$order(WC_Order) (required)
Order object.
If passed, will return held key for that coupon.
Default: null

Code of WC_Order_Data_Store_CPT::get_coupon_held_keys_for_users() WC 5.8.0

public function get_coupon_held_keys_for_users( $order, $coupon_id = null ) {
	$held_keys_for_user = $order->get_meta( '_coupon_held_keys_for_users' );
	if ( $coupon_id ) {
		return isset( $held_keys_for_user[ $coupon_id ] ) ? $held_keys_for_user[ $coupon_id ] : null;
	return $held_keys_for_user;