Support Forum
Support › Meta Box Builder › Autocalculation of many numeric fields?
Hi, is it possible at Builder add to a Numeric fields (Numeric, Slider, etc) auto-calculation possibility on new MetaBox data filling? For example at CustomField "Result" auto-calculate sum of values from fields "Price + Taxes + Delivery"?
Hi GV,
Here's a custom Fields i've wrote to do so : https://drive.google.com/file/d/1VOTBfJS5LnTdgc2N5hLi6VjUBSZrpmN-/view?usp=sharing
it supports MB builder and will display a field with the sum of other fields.
here's a working example :
[
'name' => __( 'Price', 'your-text-domain' ),
'id' => 'id_price',
'type' => 'number',
'min' => 1,
'max' => 10000,
'step' => 1,
],
[
'name' => __( 'Taxes', 'your-text-domain' ),
'id' => 'id_taxes',
'type' => 'number',
'min' => 1,
'max' => 30,
'step' => 1,
],
[
'name' => __( 'Taxes', 'your-text-domain' ),
'id' => 'id_delivery',
'type' => 'number',
'min' => 1,
'max' => 200,
'step' => 1,
],
[
'name' => __( 'Sum Price+Taxes+Delivery', 'your-text-domain' ),
'id' => 'sum_price_taxes_delivery',
'type' => 'math_operator',
'id_to_sum' => 'id_price,id_taxes,id_delivery',
]
Where you will see a new type of fields called math_operator
and where id_to_sum
is the id you want calculation for.
NB : it only support sum for the moment.
Have a nice day,
KL
NBB : You have to include it via functions.php
in your theme
Thanks for efforts, but no way. Please, add a such possibility to Visual Builder at dashboard.
as i say, it's MB builder compatible eg: you will have a "math Operator" field available on "visual builder".
simple and easy.
give it a try
Have a nice day
Ouch, OK. Sorry for misunderstanding - just very tired of 10 useless answers from MB support with banality links to documentations and thus skip your link. But your link does not work.
i just gave you access 🙂
Good job, thanks! How I can contact you directly for some improvements etc?
Can't :/
This is my full time job, and i just gave you an hand this time.
Have a nice day !