Would you like to display Single Item fields with Hidden type in your WPForms Order Summary? This can be useful when you need to add taxes, fees, or other fixed charges that should appear in the final order total. With these PHP snippets, you can easily include hidden Single Item fields in both the preview and final order summary.
By default, WPForms doesn’t display Single Item fields with Hidden type in the Order Summary. However, you might want to show these fields to maintain transparency about all charges in the order.
Setting Up Your Form
First, create a form that includes a Single Item field and set its type to Hidden from the Item Type dropdown.
Add an Order Summary field to your form and make note of your form ID as you’ll need it for the code snippets.
Adding the Code Snippet
Now it’s time to add the code to your site. These two functions work together – the first displays hidden items in the Order Summary preview that customers see while filling out the form, and the second ensures these items are included in the final order data that gets stored and processed.
If you need help on how and where to add snippets to your site, please refer to our tutorial on adding custom code.
Remember to replace 1000 with your actual form ID. If you need help finding your form ID, please review this guide on finding form and field IDs.
That’s it! Now your hidden Single Item fields will appear in the Order Summary, making all charges transparent to your customers.
Would you like to learn more about adding a currency symbol before a single item field? Take a look at our tutorial on adding currency symbol before a single item field for more details.