Sum the total amount of a specific product purchased per user and display in table

WooCommerce: Get Order info for all users. I was trying to help you get going.. After a while i had a complete solution :S… So here it is, a tested single shortcode that outputs your <table> (WooCommerce 3+ only): add_shortcode(‘user_order_info_table’, ‘sc_user_order_info_table_callback’); function sc_user_order_info_table_callback() { $result_array = array(); $users = get_users(); if($users) { foreach ($users as … Read more

WordPress plugin output formatting

Take a look at this question (and answer) – both mine, related to the formatting of the settings input area. Disable <th> $title in Plugin Options Screen? The default is to put settings in a table, with cells for the label, input, and despcription. If you want to have another format (not tables ,perhaps some … Read more

I am trying to display information from a custom table from my wordpress users pages

Because it is a custom table, you write a custom function: Put this function in your themes functions.php. Then at the position in any template where you want to display the balance: displayRemainingBalance( $currentUserId ) function displayRemainingBalance($userid) { global $wpdb; $record = $wpdb->get_var($wpdb->prepare(‘select balance from yourcustomtable WHERE userid=%d’, $userid)); echo $record->balance; } You can also … Read more

problems with loading posts in a table-row

Here’s the problem: $my_query = new WP_Query(‘cat=7’); You asked for posts in the category with the ID 7. You never said anything about how many posts to fetch, so it fetches the default, 10 per page. So instead, you need to set posts_per_page, and you need to set it to a reasonable number such as … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)