F
F
fLipE2019-01-11 16:55:48
Laravel
fLipE, 2019-01-11 16:55:48

What is the best way to implement a catalog with filters and comparison?

Prompt how it is better to implement the directory in the given situation.
Given: an old framework with controllers and smarty templates, a lot of products (more than 5000) of various types with different characteristics. All characteristics are filled in manually in the html table. (yes, the html-table is stored in the database in the "description" field).
I pulled the characteristics into an array, now I would like to hear advice from someone more experienced - how is it better to store all this?
In the future, I want to add filters by characteristics, and compare products. Therefore, I do not want to drive the characteristics into a separate table with a many-to-many relationship or a json field.
So far, I've come up with this option:
1. creating additional columns in the table with products (as many as the maximum characteristics of the product, ~ 30).
2. after that - creating a config file with product types, enumeration and description of columns for each product type.
those.:

камера => [
 поля => [
    поле_1 => [ // столбец в таблице бд называется также
        название => 'матрица'
     ]
  ]
],
блок питания => [
  поля => [
    поле_1 => [
      назввание => 'ампераж'
    ]
  ]
]

Thus, it will be possible to quickly obtain information about any product / group of products, or form a selection according to any criteria.
But maybe there is a better way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin B., 2019-01-11
@fLipE

That is, you decided not to do it as it is most correct, but at the same time, in your opinion, would it be better to make columns?
There is no option to put them in a separate table, is this the most correct one or it will still be possible in JSON
In both cases, filtering can be done
The rest is unnecessary under-optimization

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question