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

WooCommerce – Exclude category from snippet

Since product category is a taxonomy, you could try the is_tax() function. Check for the current category and then manipulate the data: add_filter( ‘woocommerce_get_price_html’, ‘custom_price_message’ ); function custom_price_message( $price ) { // Check the current category if ( ! is_tax ( ‘product_cat’, ‘category name or id here’ ) { $price .= ‘ <span class=”price-text”>’ . … Read more