• Resolved tylerriversadmin

    (@tylerriversadmin)


    Hello again,

    I’ve built an order summary page using the [CP_CALCULATED_FIELDS_RESULT] shortcode. The only problem is that the summary displays a few fields that I have set up as hidden in the editor. These fields contain rate information that we need to use for our calculations, but don’t want to show our customers. Is there any way to show an automatic summary that doesn’t display hidden fields? I’d rather not have to build numerous pages with the specific fieldnames to correspond to each of the forms I have set up.

    Thanks for your help,

    Tyler

    https://wordpress.org/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    There are two options:

    First option, inserting only the tags of fields you want to display in the summary page, described in the following links:

    http://cff.dwbooster.com/documentation#thanks-page

    http://cff.dwbooster.com/documentation#special-tags

    Second options, editing the plugin’s code, however, the code is overwritten with the plugin’s update:

    1. Open the “wp-content/plugins/calculated-fields-form/cp_calculatedfieldsf_public_int.inc.php” file with the text editor of your choice.

    2. Go to the line of code:

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>")[ 0 ].submit();

    and paste, just above it, the piece of code:

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find("[type='hidden']").remove();

    and that’s all.
    Best regards.

    Thread Starter tylerriversadmin

    (@tylerriversadmin)

    Thank you very much! I forgot to ask in my original post – will this change also affect the summary email that is sent to the customer?

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Yes, if the fields are removed before submit the form, they are not included in the notification emails or the “thank you” pages.

    Best regards.

    Thread Starter tylerriversadmin

    (@tylerriversadmin)

    Apologies, but that little bit of code seems to be killing my submit buttons. Upon submitting the page hangs and never goes to the Thank You page, and I don’t get a form-submission notification email. I believe I’ve put it in the correct place.

    The code before my edit is :

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find( '.ignore' ).closest( '.fields' ).remove();
    $dexQuery("#form_structure<?php echo $CP_CFF_global_form_count; ?>").remove();
    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>")[ 0 ].submit();

    The code after my edit:

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find( '.ignore' ).closest( '.fields' ).remove();
    $dexQuery("#form_structure<?php echo $CP_CFF_global_form_count; ?>").remove();
    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find("[type='hidden']").remove();
    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>")[ 0 ].submit();

    Please let me know if I have somehow failed to Ctrl-C > Ctrl-V correctly. Thank you.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Could you send me the link to your webpage to check it in detail, please?

    Best regards.

    Thread Starter tylerriversadmin

    (@tylerriversadmin)

    Sure. Many pages on the site have forms, but I’ve only hidden the fields on one of them thus far: http://72.41.28.254/wordpress/products/print-only-home/post-cards/

    I’ve re-implemented the above code so that you can test it after the change. If I remove the offending line, the functionality does return to normal (albeit while displaying the hidden fields in the summary page, bummer).

    Plugin Author codepeople

    (@codepeople)

    Hi,

    I see you’ve configured some calculated fields as hidden too, and if one of them is used as the field submitted to PayPal, use the following line of code instead the previous one I sent you:

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find("[type='hidden']:not(.codepeoplecalculatedfield)").remove();

    Best regards.

    Thread Starter tylerriversadmin

    (@tylerriversadmin)

    I’m sorry to report that the new code has the same effect as the old.

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Please, try this last code, instead the previous one:

    $dexQuery("#cp_calculatedfieldsf_pform<?php echo $CP_CFF_global_form_count; ?>").find('[id*="fieldname"][type="hidden"]').remove();

    Best regards.

    Thread Starter tylerriversadmin

    (@tylerriversadmin)

    Thank you! It works.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Order Summary Question’ is closed to new replies.