As previously announced via banners and our newsletters, support is no longer available through this platform.
For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.
You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.
Paid customers: Please log in to your store account for support.
Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com
Hello!
As I've seen others attempting this and it took me awhile to sort it out, I thought I'd share the solution we came up with regarding a Pivot table.
In our case, we used Advanced Custom Fields (ACF) and Custom Post Type to create a customer database capturing all services used by customers. As this data was stored in the postMeta table, we wanted a pivot table showing the customers across the top and services down the left.
As wpDataTables can't do Pivot tables natively, we opted to create a stored procedure and write the data to a new table. The table is updated each time the stored procedure is called (can be done with functions.php each time the page gets called). We will likely call this via some sort of cron script as the data does not change often.
Here is the code to create the stored procedure. Note that post_type = 'customer' is specific to our Custom Post Type. Also worth noting we changed the Y in the THEN ELSE meta value to display a large dot ⬤ but I kept it as a Y if that's what you would want to display.
I also created each of my ACF fields with a naming system that started with customer_ to make it easier to pull the data I wanted.
The resulting data gets written into a new table: customerServices. You can also change this to a different table if you like. This allows me to do a simple select * from customerServices with my wpDataTables query.
I also rotated the text of my customer columns to make nice clean columns. because the size of my table is large, I also froze the first column. Here's the CSS. I'm still doing some clean-up so I'm suspect some of the CSS needs a little attention yet.
Hopefully this helps! Also, this was not possible without a good friend and great developer to assist.
Screenshot sample:
Be well!
-Scott
Hey Scott, awesome, thank you for sharing this with everyone!
I am sure it will be of use to many users.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables