How can I establish the relationship of 2 tables, one where I have the orders, another where I have the products of that order. and that only when I select an order in one table will it show me the products of that order in the other table.
Currently I am doing it with DOM but it is somewhat difficult. I want to be able to generate a report with the order information above with the product data below.
The "Order detail" table would need to have an ID associated to the "Order list" table, and you would need to create a link column which would take you to the filtered table.
For example, if you click on a link in the top table, the link should be generated with something like this:
SELECT *,
CONCAT('<a href="url-to-the-other-table/?wdt_column_filter[1]=',`table1`.`IDcolumn`,">Link To The Order</a>') AS Link
And it would generate the link to a table pre-filtered through URL by concatenating the URL with the ID of the order.
Also, you would need to enable filtering for that other table, and to find which filter # it is (wdt_column_filter[1] is for the second column in the table).
How can I establish the relationship of 2 tables, one where I have the orders, another where I have the products of that order. and that only when I select an order in one table will it show me the products of that order in the other table.
Currently I am doing it with DOM but it is somewhat difficult. I want to be able to generate a report with the order information above with the product data below.
Hello
You may be able to do it with Foreign Keys, and they would need to be SQL Query based tables.
The "Order detail" table would need to have an ID associated to the "Order list" table, and you would need to create a link column which would take you to the filtered table.
For example, if you click on a link in the top table, the link should be generated with something like this:
And it would generate the link to a table pre-filtered through URL by concatenating the URL with the ID of the order.
Also, you would need to enable filtering for that other table, and to find which filter # it is (wdt_column_filter[1] is for the second column in the table).
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