Autocalculation of many numeric fields?

Support MB Builder Autocalculation of many numeric fields?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42646
    GVGV
    Participant

    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"?

    #42648
    KevinKevin
    Participant

    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

    #42649
    KevinKevin
    Participant

    NBB : You have to include it via functions.php in your theme

    #42659
    GVGV
    Participant

    Thanks for efforts, but no way. Please, add a such possibility to Visual Builder at dashboard.

    #42668
    KevinKevin
    Participant

    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

    #42684
    GVGV
    Participant

    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.

    #42685
    KevinKevin
    Participant

    i just gave you access 🙂

    #42690
    GVGV
    Participant

    Good job, thanks! How I can contact you directly for some improvements etc?

    #42699
    KevinKevin
    Participant

    Can't :/
    This is my full time job, and i just gave you an hand this time.

    Have a nice day !

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.