Running a WooCommerce store comes with a fair share of admin work. An Australian store owner came to me with a simple but critical need: automate invoice generation and delivery based on Elementor form submissions—all while keeping the process tightly linked to their WooCommerce orders.
Here’s how I tackled it using Elementor Pro, WooCommerce, ACF, and a bit of custom development.
The Objective
- Capture additional order details via the Elementor form.
- Link the form to the original WooCommerce Order.
- Automatically generate a custom-designed PDF invoice.
- Email that invoice to the customer right after form submission.
- Update the order with a “Form Submitted” flag.
- Let the admin easily track form submissions in the backend.
Step 1: Auto-Populating the WooCommerce Order ID
On the custom Thank You page, I loaded the Elementor form and used this script to grab the order_id from the URL:
[code lang=”js”]
javascript
document.addEventListener(‘DOMContentLoaded’, function() {
const orderId = new URLSearchParams(window.location.search).get(‘order_id’);
document.querySelector(‘#form-field-wooIDcheckout’).value = orderId;
});
[/code]
Why?
So the form data stays tied to the WooCommerce order, making post-submission workflows clean and traceable.
Step 2: Creating a Custom Post on Submission
Upon form submission, I hooked into elementor_pro/forms/new_record to create a new post (e.g. custom-orders) and store the form data using ACF fields:
[php]
//php
$post_id = wp_insert_post([
‘post_type’ => ‘custom-orders’,
‘post_status’ => ‘publish’,
‘post_title’ => ‘Order #’ . $order_id,
]);
update_field(‘custom_price’, $price, $post_id);
update_field(‘shipping_cost’, $shipping, $post_id);
[/php]
Step 3: PDF Invoice Generation
I used DomPDF behind the scenes to generate a branded invoice. The data from ACF fields was rendered into a template:
[php]
//php
$html = "<strong>Invoice for Order #{$order_id}</strong>";
$html .= "<p>Total Price: $price</p>";
$html .= "<p>Shipping: $shipping</p>";
// more details…
$dompdf->loadHtml($html);
$dompdf->render();
[/php]
The generated PDF is saved and attached to an email to the customer.
Step 4: Email the PDF Automatically
Using wp_mail() and add_filter(‘wp_mail_content_type’, ‘set_html_content_type’), the email is sent as soon as the form is submitted.
[php]
//php
$attachments = [ $pdf_path ];
wp_mail($customer_email, ‘Your Invoice’, $message_body, $headers, $attachments);
[/php]
Step 5: Update WooCommerce Order Meta
I added a meta field to track submission status:
[php]
//php
update_post_meta($order_id, ‘_form_submission_status’, ‘Yes’);
[/php]
This helps admins quickly filter which orders have completed the form process.
Step 6: Backend Admin Optimization
I modified the admin view using manage_edit-custom-orders_columns to add sortable columns like Order ID and Form Status, making tracking a breeze for staff.
Why This Setup Works
This custom setup reduces manual admin time, ensures customers get branded PDF invoices instantly, and keeps all data centralized in WordPress. For this Australian store, it meant:
- Less time spent emailing PDFs
- More control over order and client records
- Smoother customer experience
Want This Setup on Your Site?
If you’re a business owner running WooCommerce and using Elementor, I can implement this same solution tailored to your needs, with branding, layout, and automation all built in.
About Me
I’m Muhammad Adil, a Sydney AI and mobile engineer. I take on the work myself — WordPress and WooCommerce when that is the right tool, and React Native or AI products when it is not. If you are hiring, start with how I would hire an AI or React Native developer in Sydney.
Let’s discuss your next project. Book a Free Consultation
WooCommerce PDF invoicing in practice
WooCommerce PDF invoicing works best when requirements, architecture and testing stay aligned. I document the delivery approach so you can maintain the solution after launch.
Key takeaways on WooCommerce PDF invoicing
Clarify goals early, keep integrations simple, and measure outcomes. WooCommerce PDF invoicing should reduce manual work without adding fragile complexity.
Need help with WooCommerce PDF invoicing? Talk to me or explore services. See also WooCommerce documentation.
Need WooCommerce automation on your store?
I ship WordPress and WooCommerce workflows myself — see web development or talk to me about PDF invoicing, Elementor forms, and AU store ops.
Frequently asked questions
What did you automate for the WooCommerce PDF invoicing project?
I automated invoice generation and delivery for an Australian WooCommerce store. After an Elementor form submission, I create a branded PDF, email it to the customer, flag the order as submitted, and keep the extra fields in WordPress so admin work stays light.
How do the Elementor form and WooCommerce order stay linked?
On the thank-you page I read the order_id from the URL and fill a hidden Elementor field. When the form submits I hook elementor_pro/forms/new_record, store the data with ACF on a custom post, and write order meta so every invoice stays tied to the original WooCommerce order.
How is the PDF invoice generated and emailed?
I render the ACF field values into an HTML template, generate the PDF with DomPDF, then send it with wp_mail as an attachment as soon as the form is submitted. The customer gets a branded invoice without anyone copying files by hand.
Why does this matter for an Australian WooCommerce store?
Australian store owners often need consistent GST-ready invoices, clear order trails, and less admin time. I built this for a local store so branding, order status and customer email stay in one WordPress workflow instead of a fragile spreadsheet process.
How do I start a similar WooCommerce automation with you in Sydney?
I map your thank-you page, form fields, invoice layout and who receives the PDF, then ship a tested Elementor Pro, WooCommerce and ACF slice you can maintain. Talk to me from Sydney if you want the same setup on your store.