Autocalculation of many numeric fields?
Support › MB Builder › Autocalculation of many numeric fields?
- This topic has 8 replies, 2 voices, and was last updated 2 years, 3 months ago by
Kevin.
-
AuthorPosts
-
July 19, 2023 at 2:33 PM #42646
GV
ParticipantHi, 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"?
July 19, 2023 at 4:05 PM #42648Kevin
ParticipantHi 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_operatorand whereid_to_sumis the id you want calculation for.NB : it only support sum for the moment.
Have a nice day,
KL
July 19, 2023 at 4:06 PM #42649Kevin
ParticipantNBB : You have to include it via
functions.phpin your themeJuly 19, 2023 at 6:40 PM #42659GV
ParticipantThanks for efforts, but no way. Please, add a such possibility to Visual Builder at dashboard.
July 19, 2023 at 9:38 PM #42668Kevin
Participantas 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 tryHave a nice day
July 20, 2023 at 3:09 PM #42684GV
ParticipantOuch, 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.
July 20, 2023 at 3:16 PM #42685Kevin
Participanti just gave you access 🙂
July 20, 2023 at 4:03 PM #42690GV
ParticipantGood job, thanks! How I can contact you directly for some improvements etc?
July 20, 2023 at 10:08 PM #42699Kevin
ParticipantCan't :/
This is my full time job, and i just gave you an hand this time.Have a nice day !
-
AuthorPosts
- You must be logged in to reply to this topic.