Hide columns in customers email [RESOLVED]

Hello, again a question: how can I easily hide the columns ‘quantity’ and ‘unit price’ so that I have more space for the description in the emails to the customer.

It concerns all single products without quantity.

Thank you in advance.

Hi Mariëlle. The output for that table is not currently modifiable in the email output. I recommend suppressing the table completely using the gform_display_product_summary() filter:

Then, those fields will be output like every other field in your email. See if that works for you or if you need a different workaround.

Thanxs Chris, I’m going to try and dig into it, I had looked at the filter before but didn’t know how to apply it.

You can use it just like this, which will apply to all forms:

add_filter( 'gform_display_product_summary', '__return_false' );

That is PHP code which can be added to your theme functions.php file, or you can use a plugin such as this one to keep the code separate from the theme: Code Snippets – WordPress plugin | WordPress.org

Try that, and see if the output in the body of the email is more along the lines of what you are looking for.

I put this code in functions.php and changed the form-id in: 16 (16 is my form-id)

add_filter( 'gform_display_product_summary', function( $display_product_summary, $field, $form, $entry ) {
    return $form['id'] == 16 ? false : $display_product_summary;
}, 10, 4 );

But now only the total amount is visible in the email, all columns are gone, but visible in the pdf and admin email unchanged.

The intention is to hide only the 2 previously mentioned columns. Am I doing something wrong?

I just want to see this:
reply 3

You’re not doing anything wrong. As I mentioned, the table format is not modifiable. The filter prevents the table from being output in the notification at all. So you will have that data inline in the notification like the regular fields. Other than that, there’s no way to change the notification to output exactly what you are looking for.

If you think this would be a good idea to offer in Gravity Forms, I recommend adding that to our product roadmap. Click the blue :heavy_plus_sign: in the lower left on this page to add a note for our product team:

Thank you.

Ok Chris, thanks for the answer. It’s clear to me. I think it would be a useful addition to the form if the output to the emails could be manually adjusted by the administrator. I will submit it as an idea for the roadmap. I found several threads related to this so I think it might be helpful.
Then hope it ends up in Gravity Forms and not in the separately paid brother. :wink: