CalcBuilder Forum

Loading Previously Calculated Product Data into Calculator for Editing

User imprimerieareaction 2024-11-18 16:08:19

Hello,
We would like to be able to load the fields of the calculator for a product that was calculated in the past in order to edit it. Do you have any idea how I could do that?

Currently, I have modified CalcbuilderModel.php to save the id and value of the fields in the calcbuilder_stats table of the database. However, I cannot manage to fill them in JavaScript on the calculator. So I'm reaching out to you to see if you have ever done this before or if you have any leads?

Moonsoft support 2024-11-19 09:44:54

Hi,
in fact there is a built-in function that allows to configure if the user will see his last execution recovered when he enters again the calculator. This function is based on cookies for unregistered users, and stored in database for logged in users. If you set the calculator
Preferences->Show last calculator inputs

to 'User'

you will see the inputs are stored at the db table #__calcbuilder_userdata when a logged in user launches the calculator and recovered and set into the form at the end of the file
mod_calcbuilder/tmpl/user.php

when he returns to this same form.

This function doesn't 'edit' past data, it initializes the form using last execution inputs, but maybe it can do the work for you. Otherwise, if you need something more complex, you can ask for a custom development where we can introduce the required functions.

Hope this helps, best regards
Silvia Martín
Moonsoft Team

User imprimerieareaction 2024-11-19 11:53:35


Hello,

Thank you very much, this is exactly the type of functionality I was looking for. I'll make the necessary modifications in the code.

Moonsoft support 2024-11-21 09:19:42

Hi,
great, we close the ticket with this solution then, please open a new one if you have any other question.

Regards
Silvia Martín
Moonsoft Team

...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!