Answer the question
In order to leave comments, you need to log in
How to create such a table with a calculator?
Good day!
Need help with how to make this calculator? taking into account the fact that there are a large number of positions, prices for these positions and variations of the buttons on the left, when you click on which changes occur in the table and the price is recalculated? How would be more correct? create a database in SQL and access it, can anyone come across this, in which direction to dig? Plus, given the fact that I want to plant this entire almshouse on WordPress - how much is the right decision. Thank you!
here is an example of a similar calculator, a slightly different execution - www.j-detali.ru/calculator
Answer the question
In order to leave comments, you need to log in
We did these, about 5 years ago, ordered in batches, well, three a month for sure, it’s strange that the TS just wanted it right now, in any case, it’s purely paid and no one will give the full code here ... Although there are probably more characters))
) the essence of the matter:
we made the first two calculators, just as Anatoly Pychev says, completely on js, taking care of the supposedly reduced load on the client server !!)) Then we saw that our code began to appear on warezniks ... Even class names did not bother to change)))
OK. GOOGLE.
ALL other options have been and are being done purely on the server! Now, even any sneeze at the choice of model, at the choice of engine size, we do it purely through a request on the server! And even loading the information partially. As a result, it became impossible to copy the calculator a little more than completely ...)) Needleworkers can only download the form - and not all of it, we don’t ship everything at once, but give it in portions))) Well, the received data - yes, you can copy in pieces and then parse into a separate script. As the statistics of orders showed them a cursory analysis of the warezniks, the copyists switched to simpler options, we are still being bypassed)))
What about server load? Yes, nothing with the load on the server. Such calculators are used by 4-8% of all site visitors, because most come to the site already having a couple of models in their heads, they have a calculator absolutely up to their fifth leg)))
Well, in any case, advisers who write about uploading all the information to json etc. clearly far from reality! It's only the DB, because there are actually a lot of modifications, just look at the picture of the author of the question, multiply all the options AND THEN multiply by three more options - 4-speed box or 5-speed or 6-speed, then multiply by all possible reystalings and already your json will nervously smoke on the sidelines ...
Hello
I did something similar. There was also a question to use the database or not. As a result, the decision was made based on how often changes to the original data are required. If often, then you need to write through the database (+ admin panel for data correction), if rarely (once a year for example) then you can fill in the data in json lines and load it completely to the front. As a result, I wrote completely in js, without ajax calls. Works smart. It is easy to load on WP, because. doesn't touch him at all. In your version, if you do it on json objects, then you need to think over the data hierarchy correctly so that you can easily get the desired values.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question