Skip Navigation

[Geschlossen] total_sales view for different kind of customers

This support ticket is created vor 9 Jahre, 1 Monat. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by Adriano vor 9 Jahre, 1 Monat.

Assigned support staff: Adriano.

Author
Artikel
#235071
2014-08-07_14-57-52.jpg

Hi,

In my TVC-toolset WooCommerce store I created a view to display on the homepage. This view filters 4 'most sold' products using "total_sales". See image.
This would be beautifull if I had one kind of customer, but that is not the case.

I have:

A) Customers (guests and users with role 'customer');
B) Wholesale clients (users with role 'wholesale_buyer').

I would like to create a view, that outputs the most sold product to customers, and I want a view that outputs the most sold products to wholesale customers.

At the moment, I can't think of a way how to achieve that. Any ideas?

Kind regards,

Willem

#235074

Maybe the first step would be to create some kind of extra fields for the products:

a) total_sales_to_guests_and_customer_role
b) total_sales_to_wholesale_role

Can this be achieved with Types, so that with every sale the value of these fields change according to the sales?

Kind regards,

Willem

#235078

Dear willem-siebeS,

I can't see a way to do this using Views as well. Because total_sales is a meta field of product, so it's easy to add a filter or some custom code to handle post meta fields. But, to get the customer role you will need to access the Woocommerce Order table.

We have wpv_filter_query that lets you to add some custom PHP code when displaying a View listing posts: https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/

But the problem is you can only work with product fields. So, using Views you can't get any data from order table.

Please let me know if you are satisfied with my answer and if I can help you with any other related question.

Das Thema „[Geschlossen] total_sales view for different kind of customers“ ist für neue Antworten geschlossen.