mehdiboroumand
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Forum: Plugins
In reply to: [WooCommerce] Get number of all completed orders of current userI forgot to use gpt chat!
He solved my problem.
Maybe others will need it, so I will write the solution:function display_user_completed_order_count( $atts, $content = null ) { $args = shortcode_atts( array(), $atts ); $user_id = get_current_user_id(); $order_count = 0; $args = array( 'post_type' => 'shop_order', 'post_status' => 'wc-completed', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => '_customer_user', 'value' => $user_id, 'compare' => '=', ), ), ); $orders = get_posts( $args ); if ( ! empty( $orders ) ) { $order_count = count( $orders ); } ob_start(); echo number_format( $order_count ); return ob_get_clean(); } add_shortcode( 'user_completed_order_count', 'display_user_completed_order_count' );Forum: Plugins
In reply to: [Comments - wpDiscuz] Having annoying linesThank you so much.
My problem is solved.
Best regards ❤️</img>Forum: Plugins
In reply to: [LiteSpeed Cache] Error 403 when change “Page Optimization” settingsThank you so much. That’s exactly what you said. My problem is solved. Thank you for your great support.
Viewing 3 replies - 1 through 3 (of 3 total)