Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thank you again, thats work!

    I change the sum by adding items to the function “set_mnt_from_nb_select”. And it’s work. But now i try to multiply all the $entry by the factor of .14975

    ex: Inside my elseif:
    ‘$entry[‘p1_total’] = ($mnt * $entry[‘dynamichidden-prix7’]+ $entry[‘field1’] * 10 + $entry[‘field2’] * 20 + $entry[‘field3’] * 15 + $entry[‘field4’] * 25 + $entry[‘field5′] * 15)*.14975;’

    The result is realy toooooo big…

    Thank you for your help !

    Maki

    Thank you Micheal,

    I look in the plugin Shortcodes actions and filters, i select activate !!! And i tought that was the prob, but I have this error ‘Shortcodes, Actions and Filters Plugin: Error in user-provided code item named “set_mnt_from_nb_select”‘.

    i get this error in the page of the contact form 7…

    Do i have to not activate the function ?

    Thank’s

    Maki

    Hello Michael,

    Before to send you this email, I wanted to try and find. But I have a problem. I try to do a special function. And again i have 0 for the result.

    Here is the function made in the plugin Shortcode & filter:

    First in Contact form 7:
    The select menu in contact form 7 as 4 items: 1, 2, 3 and 4.

    And I pass in 3 hidden fields one for each value of the amount. And also another one for p1_total, where I set the value to 0.

    If the choice is 1, the price will be 15, if the choice is 2 or 3, the price will be 10, and if the choice is 4, the price is 7.

    +++
    The function… simple if else.

    `require_once(ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CFDBPermittedFunctions.php’);

    function set_mnt_from_nb_select(&$entry) {
    // Set $mnt to the number of item
    $mnt = $entry[‘nb_item’];
    // check the value of nb_item and multiply it by the amount if 1 per. = 15$, if 2 and 3 = 10$ et 4 and + = 7$.
    if ($mnt == 1) {
    // the nb_item = 1
    $entry[‘p1_total’] = $entry[‘dynamichidden-prix15’];
    } elseif ($mnt == 2){
    $entry[‘p1_total’] = $entry[‘dynamichidden-prix10’];
    } elseif ($mnt == 3){
    $entry[‘p1_total’] = $entry[‘dynamichidden-prix10’];
    } else {
    $entry[‘p1_total’] = $entry[‘dynamichidden-prix7’];
    }
    }
    }`

    ++

    To get the amount, In the page I use this :

    [cfdb-value header="false" form="myform" limit="1" orderby="submit_time DESC" show="nb_item" trans="nb_item=bcmul(nb_item,p1_total,0)"].00 $

    The result is zero, like I wrote.

    I also try this:

    [cfdb-value form="myform" limit="1" orderby="submit_time DESC" show="p1_total" trans="p1_total=set_mnt_field_from_nb_item(p1_total)"]

    Result nothing…
    ++

    In the page plugin do i have to select the select box “Activate”, and choose something for execute in ?

    Thank’s for your help !

    Maki

    I Micheal,

    Sorry for the delay. I will try to do a special function. For now it’s Ok !

    Maki,

    Thank’s a lot Micheal !
    It’s work fine !

    My next step now will probably be a custom function in Php. Because the amount of field1 is related with the number of item selected. It’s not seem to be possible to do so with Wp Contact Form 7.
    ex:
    [select* nb_item include_blank "1" "2" "3" "4"]

    I read, that is possible to create a form with Contact form DB, with ‘Form to Post’ + ‘wp_insert_post’ and get value.

    If i go with wpcf7, do i’ll have to modify the form already create ?

    Thank’s again !

    Hello,
    I want to do a sum of different fields trans.

    Here is my case:
    First a have make 3 trans operations on 3 different fields. field1 *20$, field2*10…

    ex for field1:
    ‘[cfdb-table form=”mytable” limit=”1″ orderby=”submit_time DESC” show=”field1″ trans=”field1=bcmul(field1,20,0)”]’

    For the 3 fields the first trans is ok, it’s work. But I don’t know, if it’s possible to do the sum of the result of the 3 trans ?

    I try this, and the result is 0 :
    ‘[cfdb-value form=”myform” limit=”1″ orderby=”submit_time DESC” show=”field1″ trans=”field1=bcmul(field1,20,0),+field2=bcmul(field2,10,0),+field3=bcmul(field3,5,0)” function=”sum” ]’

    I try different things like between : trans=”field1=bcmul(field1,20,0),+,… or
    ‘trans=”field1=bcmul(field1,20,0)+field2…’ also get “0”$

    And my second question is, is it possible to display only the value but not the name of the field and also without the border of the table ?

    Thank’s a lot

    Makinac

    Thread Starter makinac

    (@makinac)

    Saildude,

    Thank you very much. With the Media Up-Loader I was abble to find the path of the dyrectory…

    Maki

Viewing 7 replies - 1 through 7 (of 7 total)