Hello Pat,
Well, your first question and your late question are both very WooCommerce specific. Only a part of it can be related to Toolset. And I'll explain how is that below.
First of all, Toolset views(post/user/taxonomy views) can be filtered using query filters. The post views can be filtered using custom fields, taxonomies, and ONE relationship. Taxonomy views can be filtered using term fields. User views can be filtered using user fields.
However, all Toolset views can also be filtered by IDs, and that's the Toolset specific part of my reply. Especially this custom code:
add_filter( 'wpv_filter_user_query', 'include_customers_by_product_id', 99, 3 );
function include_customers_by_product_id( $query_args, $view_settings, $view_id){
global $product;
if ( $view_id == 123 ){
$query_args['include'] = get_customers_by_product_id( $product->ID );
}
return $query_args;
}
Please note, that we may not need this custom code at all, if we filter the view using a shortcode argument. Something like this:
[wpv-view name="the view to display a product buyers" customers="[a-custom-shortcode-that-will-return-customers-ids]"]
I suggested using a user view because you initially asked to display "firstname, lastname, mail and some other userfields".
However, your question is actually WooCommerce specific, for the simple reason that WooCommerce uses its own tables to store an order's items data. Especially "{prefix}woocommerce_order_items " and "{prefix}woocommerce_order_itemmeta" tables as you can see in lines 4-5 of my initial suggested code.
INNER JOIN {$wpdb->prefix}woocommerce_order_items AS i ON p.ID = i.order_id
INNER JOIN {$wpdb->prefix}woocommerce_order_itemmeta AS im ON i.order_item_id = im.order_item_id
WooCommerce registers some custom post types, that are stored in regular WordPress tables("{prefix}posts" and "{prefix}postmeta"). These post types are "product", "product_variation", "order", and "coupons". So, these can be displayed using Toolset. The data that links an order to a product is stored in "{prefix}woocommerce_order_items " and "{prefix}woocommerce_order_itemmeta" tables. And Toolset has no access to this information.
So, your last question is to get the following data, right?
1. Date of the purchase
2. Quantity of purchased product.
3. Product variant chosen (I'm working here with variable products)
Which we can rephrase as "Get the information of a product in all orders made by a specific user", right?
I am sorry to tell you, that this is a WooCommerce specific question. And it CANNOT be done without custom code.
This brings us to our support policy https://toolset.com/toolset-support-policy/
We will not provide a custom code that does not use the API of our plugins or is not related to it. The code snippets we provide also depend on the amount of custom code required to resolve a specific client issue.
And I am afraid, that what you are trying to achieve will need complex custom code that needs a wide knowledge of the WooCommerce internals.
Please reach out to the WooCommerce support, an online support community, or hire a developer to achieve that. Check the list of our partners here https://toolset.com/contractors/
All the best,
Jamal