I'm looking for a way to display some pricing tables on my site. I want to create a master price table, and then on different pages of the site display specific rows of the table. For example:
Master price table contains
Home Model 1, Price 1, Price 2, Price 3
Home Model 2, Price 1, Price 2, Price 3
Home Model 3, Price 1, Price 2, Price 3
Home Model 1 page shows only the row related to prices for that model, and so on.
Something like that is possible if you create one Manual table where you will add all the data that you need, and in one column you add the ID's of the page (this column will not be visible on the front-end).
Then you have to create the second table from MySQL query that will fetch the data from the first table and add condition to display just the data related to this page. e.g.
SELECT * FROM wp_wpdatatable_1 WHERE id_column_name = %CURRENT_POST_ID%
%CURRENT_POST_ID% will be replaced with the ID of a currently active WordPress page or post. You can take a look at this feature at this page - Making dynamic SQL Queries with placeholders.
You can try our sandbox site: Front-end & Back-end - you can find a fully functional version there to try out all plugin features.
Thanks for the information. I'm trying to test this out in the sandbox admin area, but I can't figure out the second table setup. The first table is:
Model
Tacoma
King
Salem
Anna Belle
110,000
120,000
125,000
Sequoia
310,900
345,000
320,900
Ashton Park
234,900
250,900
240,900
Then I started setting up a page for the Anna Belle, which should only have the pricing from row 1 visible. Would I need to add another column to the table for the WordPress Post ID?
I'm looking for a way to display some pricing tables on my site. I want to create a master price table, and then on different pages of the site display specific rows of the table. For example:
Is this possible with wpDataTables?
Hi Justin Hollender,
Thank you for the inquiry.
Something like that is possible if you create one Manual table where you will add all the data that you need, and in one column you add the ID's of the page (this column will not be visible on the front-end).
Then you have to create the second table from MySQL query that will fetch the data from the first table and add condition to display just the data related to this page. e.g.
%CURRENT_POST_ID% will be replaced with the ID of a currently active WordPress page or post. You can take a look at this feature at this page - Making dynamic SQL Queries with placeholders.
You can try our sandbox site: Front-end & Back-end - you can find a fully functional version there to try out all plugin features.
Hey Milos,
Thanks for the information. I'm trying to test this out in the sandbox admin area, but I can't figure out the second table setup. The first table is:
Then I started setting up a page for the Anna Belle, which should only have the pricing from row 1 visible. Would I need to add another column to the table for the WordPress Post ID?
Thanks,
Justin
Milos,
Actually, I figured it out. But the site refreshed and deleted my table from the sandbox while I was working on it.
Hi Justin Hollender,
Yes sandbox refreshes every 15th minute of every hour. If you have any more questions don't hesitate to ask.