Great question — answering as the UphillTech team:
The following shortcode will display How many times a specific coupon has been used The usage limit per user Based on the user id of the currently logged in user. // Function that runs when shortcode is called function users_coupon_usage_shortcode() { // Only for logged-in users if ( ! is_user_logged_in() ) return; global $wpdb; // Coupon code $coupon_code = 'test'; // Retrieving the coupon ID $coupon_post_obj = get_page_by_title( $coupon_code, OBJECT, 'shop_coupon' ); $coupon_id = $coupon_post_obj->ID; // Get the WC_Coupon Object $coupon_data = new WC_Coupon( $coupon_id ); // Get current user id $user_id = get_current_user_id(); // Usage limit per user $usage_limit_per_user =...
Full answer by 7uc1f3r: https://stackoverflow.stackexchange.com/a/63071197 (CC BY-SA 4.0).
Need it done for your business? UphillTech.