• Resolved 25user

    (@25user)


    Hey. Hey,

    I need some advice.

    I don’t know how I can list Merge tags in my mail.

    If I use Merge tags : {all_fields}
    I get all the information even the unwanted ones
    If I use Merge tags : {all_non_empty_fields}
    I get less information but still show all field calculations.

    Please advise, how can I list all fields in a query form that contains sections and repeaters without calculation fields?

    I want to do an order summary for a client and then just post a quote ( total calculation from each product)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hi @25user

    Hope you are doing fine!

    Below the {all_fields} and {all_non_empty_fields} there is a section in the dropdown named Optional Fields. Could you please verify if that is what you are looking for?

    https://snipboard.io/df4LQg.jpg

    About this other question, could you provide some additional information about the fields you need to display?

    how can I list all fields in a query form that contains sections and repeaters without calculation fields?

    You can also help us share the form export and let us know about the fields you need to include in the email . Please take a look at the following doc on how to export a form:
    https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    If you are concerned about any sensitive information in the form, then you can duplicate your form, remove any sensitive information, and then export it.

    You can share the export file via Google Drive, Dropbox or any cloud services in the next reply.

    Looking forward to your response.

    Kind regards

    Luis

    Thread Starter 25user

    (@25user)

    Hi

    link to form here:
    https://drive.google.com/file/d/1Hcz5jBqRsCu6tGxNtEk0Y5ERRpsnn6IK/view?usp=sharing

    here is the email that generates
    https://drive.google.com/file/d/1wT5CIQNVTpCHFYebapZziCtRP6wOqezm/view?usp=sharing

    in orange is marked what calculations should remain hidden.

    for the client when the email is sent. must not appear in the mail!

    How do I get the calculations field out of the mail. The hide function in the field settings does not help. And I haven’t found another function to list all data without calculations.

    On the other hand to manually list everything needed, probably not possible within sections and repeats I don’t know about in advance.

    Please advice how to list everything without orange fields.


    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @25user,

    Thanks for sharing the form export and the screenshot it’s helpful in understanding the query.

    Sounds like you are looking to exclude all the calculation fields highlighted in the screenshot which also includes empty calculation fields.

    At the moment, I’m afraid, there isn’t any out-of-the-box setting to perform such an exclusion, other than using the existing {all_fields}, {all_non_empty_fields} form data.

    I’m checking with our developer to see if there is any workaround that could be looked at in such a use case.

    Will keep you posted once we get further feedback asap.

    Kind Regards,

    Nithin

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @25user,

    in orange is marked what calculations should remain hidden.

    I just realised from the screenshot, it seems like you have marked all the calculation fields with orange.

    I suppose you still want to display only the total pricing which I suppose would be the Cenová kalkulace – Celkem field, right? Asking specifically as Cenová kalkulace – Celkem is highlighted in orange and double checking if I’m not missing any other calculation fields which you are looking to display.

    Also, will you be adding more emails notification to the same form? Because the workaround will also change based on that.

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter 25user

    (@25user)

    Yes,

    Thank you for trying to untangle my problem. I have hope that the developers will help.

    I don’t want to show any price or total price.

    I’m sending 3 emails
    1/ what the client entered
    2/ everything and prices to the sales rep
    3/ An email based on the request with the total price implementation for approval.

    So no I don’t need any prices and also I can playfully call up the price as such on my own.

    So to be more precise I rely on developers and their quick intervention in code and modification of Merge tags: {all_fields} where they create a copy and remove the code that lists the calculation fields.

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @25user,

    Thank you for the detailed explanation.

    The devs are currently reviewing this in order to identify potential solutions. We will be updating you when there’s more info or feedback.

    We appreciate your patience as we work to resolve the issue!

    Best regards,
    Dmytro

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @25user

    You can add this code to the site as MU plugin:

    <?php 
    
    add_filter( 'forminator_replace_custom_form_data', 'wpmu_custom_replace_form_macros', 90, 4 );
    function wpmu_custom_replace_form_macros( $content, $custom_form, $prepared_data, $entry ) {
    	
    	//# {all_non_empty_fields_no_calc}
    	
    	if ( strpos( $content, '{all_non_empty_fields_no_calc}' ) !== false ) {
    		
    		$filtered_entry_meta = array();
    		
    		foreach ( $entry->meta_data as $field_id => $field_value ) {
    			
    			if ( strpos( $field_id, 'calculation' ) !== false ) {
    				continue;
    			}
    			
    			$filtered_entry_meta[$field_id] = $field_value;
    			
    		}
    		
    		if ( !empty( $filtered_entry_meta ) ) {
    			$entry->meta_data = $filtered_entry_meta;
    		}
    				
    			
    		$replacement = forminator_get_formatted_form_entry( $custom_form, $entry, true ); ;
    		$content = str_replace( '{all_non_empty_fields_no_calc}', $replacement, $content );
    		
    	}
    	
    	return $content;
    	
    }

    To do so:

    – create an empty file with a .php extension (e.g. “forminator-custom-allmacro-replacement.php” or similar)
    – copy and paste code into it
    – save the file and upload it to the “/wp-content/mu-plugins” folder of your site’s WordPress installation

    With this code everything should work as it does (including all the standard macros) but it adds another one:

    {all_non_empty_fields_no_calc}

    It acts exactly the same as {all_non_empty_fields} but additionally skips all calculation fields.

    You can still add individual fields, including calculations, using individual fields. So if, for example, you got 10 calculation fields on the form, you want to skip them but include only last one you could use this in e-mail body:

    {all_non_empty_fields_no_calc}
    Total value: {calculation-10}

    I hope this helps!

    Best regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @25user ,

    We haven’t heard from you for some time now, so it looks like you don’t have more questions for us.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Merge tags’ is closed to new replies.