• Resolved mrpetreli

    (@mrpetreli)


    Hi

    I figured out how to add <%payment_option%> to emails, however how do I pull <%payment_option%> value when exporting to csv?

    Additionally I don’t see it in the list of field names to be able to create a calculated field?

    Any advice?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    I’m sorry, the current version of the plugin does not include this information in the exported CSV files, only if the entry was paid or not, however I agree that the payment option used by the user can be very useful in different case, and I will include it in the CSV files in a next update of the plugin.

    About managing the payment option through the equations, this field is not part of the structure of the form, so, you should manage it with javascript. For example, the following equation ticks by default the “Pay with PayPal” option:

    (function(){
    jQuery('[name="bccf_payment_option_paypal"][value="1"]').prop('checked', true);
    })()

    and the following one ticks the “Pay Later” option:

    (function(){
    jQuery('[name="bccf_payment_option_paypal"][value="0"]').prop('checked', true);
    })()

    Another situation.

    If your current equation is for example: fieldname1+fieldname2, but you want increase the result in a 10% if the user select the “Pay with PayPal” option.

    – Insert a “Hidden” field in the form (I’ll call it fieldname3) with zero (0) as the predefined value.

    – Modify the equation as follows:

    (fieldname1+fieldname2)*(1+fieldname3*0.1)

    – Finally, insert a “HTML Content” field in the form with the following piece of code as its content:

    <script>
    jQuery(document).on('change', '[name="bccf_payment_option_paypal"]', function(){
    var v = (this.value == 1) ? 1 : 0;
    jQuery('[id*="fieldname3_"]').val(v).change();
    });
    </script>

    and that’s all.
    Best regards.

    Thread Starter mrpetreli

    (@mrpetreli)

    Hi Thank you for your answer. I will see what I can do with this…if not I will await the update.

    Thread Starter mrpetreli

    (@mrpetreli)

    Hi

    Just a question

    How could I use the following code to change a new field to ‘Yes’ or ‘No’ so we would know which option was selected.

    <script>
    jQuery(document).on('change', '[name="bccf_payment_option_paypal"]', function(){
    var v = (this.value == 1) ? 1 : 0;
    jQuery('[id*="fieldname3_"]').val(v).change();
    });
    </script>

    How would I do it

    • This reply was modified 7 years, 6 months ago by mrpetreli.
    Plugin Author codepeople

    (@codepeople)

    Hello,

    If the radio buttons field with the “Yes”, “No” texts is for example the fieldname1, the code to use would be:

    <script>
    jQuery(document).on('change', '[name="bccf_payment_option_paypal"]', function(){
    if(this.value == 1) jQuery('[id*="fieldname1_"][vt="Yes"]').prop('checked', true).change();
    else jQuery('[id*="fieldname1_"][vt="No"]').prop('checked', true),change();
    });
    </script>

    Best regards.

    Thread Starter mrpetreli

    (@mrpetreli)

    Thank you, that may help with a workaround

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Return in output to CSV’ is closed to new replies.