The project involves creating a script that inserts the content of JSON files into Elementor/Wordpress pages (I will provide the credentials for a pre-installed Wordpress/Elementor with a configured theme).
The content to be inserted consists of agricultural market price indicators, and these indicators are divided into categories and sub-categories.
I need this in one day.
The content should be displayed in a table format like this: [login to view URL] (I will send an Illustrator file with this design).
The entire script should run from Wordpress Snippets (using the Code Snippets plugin), and to insert the content into a page, a shortcode must be used.
In the snippet, the path of the folder containing the JSON files should be indicated.
In this folder, there will be a file called "[login to view URL]" (I attach the file) where all the information to be displayed will be included, except for what is necessary for indicator´s chart, this information will be in a file per indicator that will named after the ID of each indicator (e.x. for the indicator with ID 2 the fille will be, "[login to view URL]", I attach the file ) .
------ Wordpress Elementor Pages
There will be a general page where the information of all categories (each with its subcategories and indicators) will be displayed, and then a page for each parent category, which will be exactly the same but will only display the content of that sub-category.
-- GENERAL PAGE
On this Wordpress page, the shortcode [agroprecios all] will be inserted. The system must insert the content of all parent categories, their child categories, and their indicators. It should be displayed like this: [login to view URL]
For this, the system must refer to the [login to view URL] file. The first thing you can see there is the ID of the parent category, its name (appears as "Nombre"), and its order (appears as "Orden").
The code looks like this:
```json
"parent-categories": [
{
"Id": "1",
"Nombre": "Vacunos",
"Orden": "1"
},
```
The names of the parent categories should be displayed as titles (with the H1 tag) in the corresponding order indicated in the "Orden" field.
Within each parent category, the titles of the child categories (with the H2 tag) must be displayed, and within each one, the indicators that compose it in a table like this [login to view URL]
The information of the child categories appears like this. For example, for the parent category with ID 1, it is displayed like this:
"category-1": [
{
Inside this, the information of each indicator that should be shown in the table is displayed. For example, an indicator looks like this:
{
"Nombre": "Novillos gordos abasto especiales",
"Id": "1",
"Orden": "1",
"Precio fijo": "187",
"Precio rango menor": "178",
"Precio rango mayor": "196",
"Precio anterior": "188",
"Precio anterior rango menor": "180",
"Precio anterior rango mayor": "197",
"Unidad de medición": "USD por Saco",
"Variación": "-5.61%"
},
In the table in the "Precio" column, if the JSON file of the indicator has the fields "Precio rango menor" and "Precio rango mayor" empty, then the value of "Precio fijo" should be shown. If, on the contrary, "Precio rango menor" and "Precio rango mayor" have a value, then these values separated by a dash should be shown (e.g., 178 - 196). Similarly, for the "Precio mes anterior" column of the table, if the JSON file of the indicator has the fields "Precio anterior rango menor" and "Precio anterior rango mayor" empty, then the value of "Precio anterior" should be shown. If, on the contrary, "Precio anterior rango menor" and "Precio anterior rango mayor" have a value, then these values separated by a dash should be shown. In the "Variación" column, as shown in the example [login to view URL], if the number is positive, a green arrow pointing up should be shown, and if the number is negative, a red arrow pointing down should be shown. If you read this please comment pink elephant so I know you had read it.
In the "Histórico" column, an icon is displayed, when pressed, it must open a modal box (using the default Elementor modal) that should display a graph of the historical values of the indicator. These values are found in the file of each indicator (e.g., for the indicator with ID 2, they are found in the file [login to view URL]). This graph should be created using the free script [[login to view URL]]([login to view URL]), using the Line Chart
type [login to view URL] the chart must show one line per year, this means if there is information of 2022, 2023 and 2024 it will show 3 lines. On the left the graph must show the information of "Unidad de medida” field e.g., " USD por kilo ".
-- PARENT CATEGORY PAGE
On the parent category pages, the shortcode [agroprecios id="4"] should be inserted, and only the information of that parent category should be displayed, i.e., the same as on the general page but only with the titles of the child categories that compose it and the indicators that compose it.
You will have to do this on my server, I will send you CPANEL/Wordpress credentials. Everything must be done using only Snippets (i will copy the generated snippet to another Wordpress to test if everything works well importing only that Snippet)