Installation & Setup
Section 01

Installation & Setup

Complete guide to installing and activating QuarkCode PDF Invoices Pro

📚 What You'll Learn: This guide walks you through the complete installation process of QuarkCode PDF Invoices Pro for WooCommerce. By the end, you'll have the plugin installed, activated, and ready for configuration.
System Requirements

Before installing, ensure your WordPress site meets these requirements:

  • WordPress Version: 5.0 or higher
  • WooCommerce Plugin: Must be installed and active
  • PHP Version: 7.4 or higher
  • Server: Apache or Nginx web server
  • Memory: 128MB minimum (256MB recommended)
1

Verify WooCommerce is Installed

This plugin requires WooCommerce to function. Before proceeding:

  1. Log into your WordPress admin dashboard
  2. Go to Plugins → Installed Plugins
  3. Look for WooCommerce in the list
  4. Ensure it shows as "Active"
💡 Don't have WooCommerce?

If WooCommerce is not installed, go to Plugins → Add New, search for "WooCommerce", install it, and activate it before continuing.

2

Upload the Plugin

There are two methods to upload the plugin:

Method 1: Upload via WordPress Admin (Recommended)

  1. In your WordPress dashboard, go to Plugins → Add New
  2. Click the "Upload Plugin" button at the top
  3. Click "Choose File" and select qc-pdf-invoices-pro.zip
  4. Click "Install Now"
  5. Wait for the upload and installation to complete

Method 2: Upload via FTP/cPanel

  1. Extract the ZIP file on your computer
  2. Connect to your server via FTP or File Manager
  3. Navigate to /wp-content/plugins/
  4. Upload the entire qc-pdf-invoices-pro folder
  5. Ensure all files are uploaded successfully
Important Note

If using FTP, make sure the plugin folder has the correct permissions (755 for directories, 644 for files).

3

Activate the Plugin

After uploading, activate the plugin:

  1. Go to Plugins → Installed Plugins
  2. Find "QuarkCode PDF Invoices Pro For WooCommerce"
  3. Click the "Activate" button
  4. Wait for the activation success message
Plugin Activated Successfully!

Once activated, you'll see a success message. The plugin will automatically check that WooCommerce is active before fully loading.

4

Verify Installation

Confirm the plugin is working correctly:

  1. Go to WooCommerce → Settings
  2. Look for a new tab called "PDF Invoices"
  3. Click on the tab to access plugin settings
  4. If you see the settings page, installation was successful!
🎯 What Happens After Activation?

The plugin automatically:

  • ✓ Creates necessary database tables for invoice numbers
  • ✓ Sets up default invoice templates
  • ✓ Integrates with WooCommerce order screens
  • ✓ Adds invoice generation capabilities to your orders
🔧 Troubleshooting Installation Issues

Problem: "Plugin could not be activated"

Solution: This usually means WooCommerce is not installed or active. Install and activate WooCommerce first, then try activating this plugin again.

Problem: "The uploaded file exceeds upload_max_filesize"

Solution: Your server's upload limit is too small. Either:

  • Use the FTP upload method instead
  • Ask your hosting provider to increase the upload limit
  • Add this to your php.ini: upload_max_filesize = 10M

Problem: "Plugin is activated but settings tab doesn't appear"

Solution: Try these steps:

  1. Deactivate and reactivate the plugin
  2. Clear your browser cache
  3. Check that WooCommerce is properly installed
  4. Ensure you're using WordPress 5.0+ and PHP 7.4+
✨ Installation Complete!

Your plugin is now installed and ready to use. Proceed to Section 02: Initial Configuration to set up your company information and basic preferences.

Initial Configuration
Section 02

Initial Configuration

Set up your plugin with company information and basic preferences

🎯 What You'll Learn: After installing the plugin, you need to configure basic settings to start generating professional invoices. This guide covers accessing plugin settings, entering your company information, uploading your logo, and configuring essential preferences.
1

Accessing Plugin Settings

Navigate to the plugin settings page:

  1. From your WordPress dashboard, hover over WooCommerce in the left menu
  2. Click on Settings
  3. You'll see a new tab called "PDF Invoices" at the top
  4. Click on the "PDF Invoices" tab
  5. This opens the main settings page for the plugin
💡 Alternative Access Method

You can also access settings from:

  • • Direct URL: wp-admin/admin.php?page=wc-settings&tab=pdf_invoices
  • • Plugins page: Click "Settings" under the plugin name
2

Company Information Setup

Configure your business details that will appear on all invoices:

Setting Description
Company Name
Your business or store name that appears at the top of invoices. Example: "ABC Electronics Store"
Company Address
Your full business address including street, city, state, and zip code. This appears in the invoice header.
Company Phone
Business phone number for customer contact. Format: +1 (555) 123-4567
Company Email
Official business email address displayed on invoices
Tax/VAT Number
Your business tax identification or VAT registration number (if applicable)
Company Website
Your business website URL that appears in the invoice footer
📝 Pro Tip

Fill in all company information completely. This information is required for legal compliance in many countries and adds professionalism to your invoices.

3

Upload Company Logo

Add your company logo to invoices for professional branding:

  1. In the plugin settings page, find the "Company Logo" section
  2. Click the "Upload Logo" or "Choose Image" button
  3. Select your logo image from your computer or media library
  4. Click "Select" or "Insert"
  5. Your logo preview will appear in the settings
Logo Specifications

Recommended format: PNG with transparent background
Recommended size: 200-400 pixels wide
Maximum file size: 2MB
Supported formats: PNG, JPG, JPEG, GIF

🎨 Logo Tips
  • ✓ Use a horizontal logo format for best results
  • ✓ Ensure good contrast against white/light backgrounds
  • ✓ PNG with transparent background looks most professional
  • ✓ Keep file size small for faster PDF generation
4

Configure Basic Preferences

Set up essential plugin behaviors and defaults:

Setting Description
Enable Automatic Invoice Generation
When enabled, invoices are automatically created when orders reach specific statuses (Processing, Completed)
Invoice Date
Choose between "Order Date" or "Invoice Generation Date". Order Date uses when the order was placed.
Paper Size
Select your preferred paper format: A4, A5, Letter, or Legal. A4 is standard in most countries.
Invoice Template
Choose from 7 professional templates: Default, Bold Modern, Classic Elegant, Corporate Professional, Creative Contemporary, Modern Minimalist, or Refund Theme
Display Product SKU
Show product SKU codes on invoices (useful for inventory tracking)
Display Product Images
Include product thumbnail images in invoices
⚙️ Recommended Initial Settings

For most stores, we recommend:

  • Automatic Generation: Enabled
  • Invoice Date: Order Date
  • Paper Size: A4 (or Letter for US)
  • Template: Default or Corporate Professional
  • Display SKU: Enabled (if you use SKUs)
5

Save Your Configuration

After configuring all settings:

  1. Scroll to the bottom of the settings page
  2. Click the "Save Changes" button
  3. Wait for the success confirmation message
  4. Your settings are now active!
Important

Always click "Save Changes" after modifying any settings. Navigating away without saving will lose your changes.

🧪 Test Your Configuration

Verify your configuration is working correctly:

  1. Go to WooCommerce → Orders
  2. Open any existing order (or create a test order)
  3. In the order actions dropdown, select "Generate Invoice"
  4. Click "Go"
  5. A PDF invoice should be generated and downloaded
  6. Open the PDF and verify:
    • Your company name and logo appear correctly
    • Company address and contact information are displayed
    • The selected template style is applied
    • Invoice formatting looks professional
✓ Configuration Checklist

Before moving to the next section, ensure:

  • ✓ Company name is entered
  • ✓ Company address is complete
  • ✓ Contact details (phone/email) are added
  • ✓ Logo is uploaded and displays correctly
  • ✓ Paper size is set to your preference
  • ✓ Invoice template is selected
  • ✓ All settings are saved
  • ✓ Test invoice generated successfully
🎉 Configuration Complete!

Your plugin is now fully configured with your business information and preferences. You're ready to start generating professional invoices!

Next: Proceed to Section 03: Invoice Generation to learn how to automatically and manually create invoices for your orders.

Invoice Generation
Section 03

Invoice Generation

Generate professional PDF invoices automatically or manually

⭐ Core Feature
🎯 What You'll Learn: This guide covers everything about generating invoices for your WooCommerce orders. Learn how to enable automatic generation, manually create invoices, download PDFs, and access invoices from the order screen.
🔄 Automatic Invoice Generation

The plugin can automatically generate invoices when orders reach specific statuses. This is the recommended method for most stores as it requires no manual intervention.

How Automatic Generation Works

When enabled, the plugin monitors your WooCommerce orders and automatically generates invoices when orders transition to specific statuses. The PDF is created in the background and attached to the order.

Order Status Triggers

Invoices are automatically generated for these order statuses:

Order Status When Invoice Generates
Processing When order is marked as "Processing" (payment received, awaiting fulfillment)
Completed When order is marked as "Completed" (order fulfilled and delivered)
💡 Recommended Configuration

Enable automatic generation for "Processing" status. This generates invoices immediately after payment is received, allowing them to be included in packing slips and shipments.

Enable Automatic Generation

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Find the "Automatic Invoice Generation" option
  3. Check the box to enable automatic generation
  4. Select which order statuses should trigger invoice creation:
    • Processing (recommended)
    • Completed (optional)
  5. Click "Save Changes"
Important Note

Once enabled, invoices will only be generated for new orders or orders that transition to the selected statuses after enabling. Existing orders will need manual invoice generation.

Manual Invoice Generation
1

Generate Invoice from Single Order

You can manually generate invoices for any order at any time:

  1. Go to WooCommerce → Orders
  2. Click on the order you want to create an invoice for
  3. In the "Order Actions" dropdown (top right of the order page)
  4. Select "Generate Invoice"
  5. Click the "Go" button (▶)
  6. The invoice PDF will be generated and automatically downloaded
📥 What Happens After Generation?

When you generate an invoice:

  • ✓ PDF is created and saved to the server
  • ✓ Invoice number is assigned automatically
  • ✓ Invoice information is stored with the order
  • ✓ PDF is downloaded to your computer
  • ✓ Customer can access it from their account
2

Invoice Meta Box

Each order page includes a dedicated Invoice meta box showing invoice status and actions:

Meta Box Information

  • Invoice Status: Shows if an invoice exists for this order
  • Invoice Number: Displays the assigned invoice number (e.g., INV-2024-001)
  • Invoice Date: Shows when the invoice was generated
  • Quick Actions: Buttons to download, view, or regenerate the invoice

Available Actions in Meta Box

  1. "Download Invoice" - Download the PDF to your computer
  2. "Regenerate Invoice" - Create a fresh invoice (useful after order changes)
  3. "Email Invoice" - Send the invoice directly to the customer
Regenerating Invoices

Regenerating an invoice will create a new PDF with the current order data. The invoice number remains the same. This is useful when you've updated order details after invoice generation.

3

Bulk Invoice Generation

Generate invoices for multiple orders at once:

  1. Go to WooCommerce → Orders
  2. Select multiple orders using the checkboxes
  3. In the "Bulk Actions" dropdown at the top
  4. Select "Generate Invoices"
  5. Click "Apply"
  6. Invoices will be generated for all selected orders
  7. A success message shows how many invoices were created
🚀 Bulk Generation Tips
  • Process up to 50 orders at a time for best performance
  • Bulk generation runs in the background
  • You can continue working while invoices generate
  • Existing invoices are skipped automatically
📥 Downloading Invoices

There are multiple ways to download invoice PDFs:

Method 1: From Order Actions

  1. Open the order in WooCommerce
  2. Use Order Actions → Download Invoice
  3. PDF downloads immediately

Method 2: From Invoice Meta Box

  1. Open the order page
  2. Find the "Invoice" meta box on the right side
  3. Click the "Download" button

Method 3: From Orders List

  1. On the WooCommerce → Orders page
  2. Hover over an order row
  3. Click the "Invoice" quick action link
  4. PDF downloads automatically
✓ Download Location

All invoice PDFs are downloaded to your browser's default download folder. The filename format is: invoice-[order-number].pdf

Example: invoice-12345.pdf

👁️ Accessing Invoice Information

View invoice details and status directly from WooCommerce:

Order Details Page

Each order with an invoice shows:

  • Invoice Number: Unique identifier (e.g., INV-2024-001)
  • Generation Date: When the invoice was created
  • File Status: Whether the PDF file exists
  • Download Link: Quick access to the PDF

Orders List View

On the main orders page, you'll see:

  • Invoice icon/indicator for orders with invoices
  • Quick action link to download invoice
  • Invoice number in order details column
Best Practices

Recommended Workflow

  1. Enable Automatic Generation: Set it to trigger on "Processing" status
  2. Test First: Generate a test invoice and verify all information is correct
  3. Check Invoices: Periodically verify invoices are generating correctly
  4. Regenerate When Needed: If you modify order details, regenerate the invoice
  5. Bulk Generate for Old Orders: Use bulk actions for existing orders
💡 Pro Tips
  • Invoices are stored in: /wp-content/uploads/wc-invoices/
  • Each invoice has a unique sequential number
  • Invoices cannot be deleted, only regenerated
  • Customers can download invoices from their My Account page
  • Invoices can be automatically attached to order emails (see Section 06)
🔧 Common Issues

Issue: "Invoice could not be generated"

Solution: Check that:

  • The order has billing information
  • WooCommerce is properly configured
  • Server has write permissions to /wp-content/uploads/

Issue: Invoice number not showing

Solution: The invoice number is assigned only after the PDF is generated. Generate the invoice first.

Issue: Automatic generation not working

Solution:

  • Verify automatic generation is enabled in settings
  • Check that the order status matches your trigger settings
  • Ensure the order doesn't already have an invoice
🎉 Invoice Generation Mastered!

You now know how to generate invoices automatically and manually, download PDFs, and access invoice information from your orders.

Next: Proceed to Section 04: Invoice Numbering System to learn how to customize invoice number formats, prefixes, and sequential numbering.

Invoice Numbering System
Section 04

Invoice Numbering System

Configure custom invoice numbering with prefixes, formats, and sequential numbering

🎯 What You'll Learn: Master the invoice numbering system to create professional, sequential invoice numbers with custom prefixes, suffixes, and date-based formats. Learn how to configure, reset, and manage invoice numbering for your store.
📖 Understanding Invoice Numbering

The plugin uses a flexible numbering system that automatically generates unique, sequential invoice numbers for each order. The numbering format is fully customizable with multiple components:

Component Description Example
{prefix} Custom text before the number INV-
{year} Current year (4 digits) 2024
{month} Current month (2 digits) 12
{increment} Sequential number counter 00001
{suffix} Custom text after the number -US
💡 How It Works

When an invoice is generated, the plugin combines these components based on your format settings to create a unique invoice number. The increment counter automatically increases with each new invoice.

🔢 Sequential Numbering Setup
1

Access Numbering Settings

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Scroll down to the "Invoice Numbering" section
  3. Here you'll find all numbering configuration options
2

Configure Number Format

Set up your invoice number format using the available components:

Invoice Number Format Field

Enter your desired format using the component placeholders:

  • Use {prefix}, {year}, {month}, {increment}, {suffix}
  • Combine components in any order
  • Add separators like hyphens, underscores, or slashes
Format Examples
Format: {prefix}{year}{month}{increment}
Result: INV-202412-00001
Format: {prefix}{increment}
Result: INV-00001
Format: {prefix}{year}/{increment}{suffix}
Result: INV-2024/00001-US
Format: {year}-{month}-{increment}
Result: 2024-12-00001
📝 Recommended Format

For most businesses: {prefix}{year}{month}{increment}

This provides: Clear prefix, year/month organization, and sequential numbering

Example: INV-202412-00001

📝 Prefix and Suffix Configuration
3

Set Invoice Prefix

The prefix appears at the beginning of your invoice number:

  1. Find the "Invoice Number Prefix" field
  2. Enter your desired prefix text
  3. Common prefixes:
    • INV- for standard invoices
    • INVOICE- for full word prefix
    • 2024- for year-based prefix
    • STORE- for store identifier
    • ABC- for company initials
Prefix Guidelines

• Keep prefixes short (2-6 characters)

• Use uppercase for clarity

• Include a separator (- or _) at the end

• Avoid special characters that may cause issues

4

Set Invoice Suffix

The suffix appears at the end of your invoice number:

  1. Find the "Invoice Number Suffix" field
  2. Enter your desired suffix text (optional)
  3. Common suffixes:
    • -US for country identification
    • -STR1 for store/location identifier
    • -WEB for online orders
    • -X for custom categories
💡 When to Use Suffixes

Suffixes are useful when you need to:

  • Identify orders from different countries
  • Distinguish between multiple stores
  • Categorize invoices by sales channel
  • Add additional classification
📅 Year/Month Based Numbering

Include year and month in your invoice numbers for better organization:

Using {year} Component

The {year} placeholder inserts the current 4-digit year:

  • Format: {prefix}{year}-{increment}
  • Result: INV-2024-00001
  • Benefit: Easy to identify invoice age and organize by year

Using {month} Component

The {month} placeholder inserts the current 2-digit month:

  • Format: {prefix}{year}{month}-{increment}
  • Result: INV-202412-00001
  • Benefit: Track invoices by month and year
Date-Based Format Examples
Format: INV-{year}-{increment}
INV-2024-00001
Format: INV-{year}/{month}-{increment}
INV-2024/12-00001
Format: {year}{month}{increment}
20241200001
Important: Counter Resets

When using {year} or {month} components, the increment counter does NOT automatically reset when the year or month changes. You must manually reset the counter if you want numbering to restart (e.g., from 00001 each new year).

🔄 Reset Numbering

You can reset the invoice counter to start numbering from a specific value:

When to Reset

  • Start of a new year
  • Start of a new fiscal period
  • After changing numbering format
  • When starting a new business period
  • After migrating from another system

How to Reset Counter

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Scroll to "Invoice Numbering" section
  3. Find the "Reset Invoice Counter" option
  4. Enter the starting number (e.g., 1 or 1001)
  5. Click "Reset Counter" button
  6. Confirm the action
  7. Next invoice will use the new starting number
⚠️ Warning: Cannot Be Undone

Resetting the counter is permanent. The next invoice will use the new counter value. This does NOT affect existing invoices - only new invoices generated after the reset.

💡 Best Practice

When resetting for a new year:

  1. Wait until the first invoice of the new year
  2. Reset counter to 1
  3. The new invoice will be: INV-2025-00001
🎯 Custom Starting Number

Set a custom starting number for new installations or after format changes:

Setting Initial Counter Value

  1. In the "Invoice Numbering" settings
  2. Find "Starting Invoice Number" field
  3. Enter your desired starting value
  4. Examples:
    • 1 - Start from 1 (default)
    • 1001 - Start from 1001
    • 5000 - Start from 5000
  5. Save settings
📝 Why Use Custom Starting Numbers?
  • Professional appearance: Starting from 1001 makes your store look established
  • Continuing from old system: Match numbering from previous invoice system
  • Multiple stores: Use different ranges for different stores (1000-1999, 2000-2999)
Starting Number Examples
Starting from: 1 | Format: INV-{increment}
INV-00001, INV-00002, INV-00003...
Starting from: 1001 | Format: INV-{year}-{increment}
INV-2024-01001, INV-2024-01002...
Starting from: 10000 | Format: {increment}
10000, 10001, 10002...
Numbering Best Practices

Recommended Configurations

Configuration Scenarios
Small Business:
Format: INV-{year}-{increment}
Prefix: INV-
Starting: 1001
Result: INV-2024-01001
Multi-Location Business:
Format: {prefix}{year}{month}{increment}{suffix}
Prefix: INV-
Suffix: -NYC
Result: INV-202412-00001-NYC
International Business:
Format: {prefix}{year}/{increment}{suffix}
Prefix: INV-
Suffix: -US
Result: INV-2024/00001-US

Key Guidelines

  • Always include a prefix - Makes invoice numbers instantly recognizable
  • Use year component - Helps with organization and record-keeping
  • Start from 1001 - Looks more professional than starting from 1
  • Keep it consistent - Don't change format mid-year
  • Test before going live - Generate test invoices to verify format
  • Document your format - Keep a record of your numbering system
What to Avoid
  • ✗ Changing format frequently - Confuses accounting
  • ✗ Using special characters - May cause system issues
  • ✗ Very long formats - Keep invoice numbers readable
  • ✗ Resetting counter mid-period - Can cause duplicate numbers across years
🧪 Testing Your Number Format

Always test your numbering configuration before using it in production:

  1. Configure your format, prefix, and suffix
  2. Set your starting number
  3. Save settings
  4. Create a test order
  5. Generate an invoice for the test order
  6. Verify the invoice number matches your expected format
  7. Generate 2-3 more test invoices to verify sequential numbering
  8. Check that numbers increment correctly
✓ Testing Checklist
  • ✓ Invoice number format is correct
  • ✓ Prefix displays properly
  • ✓ Suffix displays properly (if used)
  • ✓ Year/month components show correct dates
  • ✓ Sequential numbering works (1, 2, 3...)
  • ✓ Starting number is correct
  • ✓ Numbers are unique for each invoice
🎉 Numbering System Configured!

You now have a professional invoice numbering system set up with custom formats, prefixes, and sequential counters.

Your invoice numbering is ready! All new invoices will use your configured format automatically.

Invoice Templates

Section 05

Invoice Templates

Select and customize from 7 professional invoice template styles

✨ 7 Professional Templates

🎯 What You'll Learn: Choose from 7 professionally designed invoice templates to match your brand. Learn how to switch between templates, preview them before applying, and understand the unique features of each design style.

🎨
Available Template Styles

The plugin includes 7 professionally designed invoice templates, each with a unique style and layout. All templates are fully functional and include your company information, order details, and customer data.

Default
Clean and professional standard invoice design suitable for any business type. Simple layout with clear sections.
  • Simple, clean layout
  • Standard formatting
  • Universal design
  • Easy to read

Bold Modern
Contemporary design with bold headers and modern typography. Perfect for tech companies and startups.
  • Bold header sections
  • Modern typography
  • Contemporary style
  • Strong visual hierarchy

Classic Elegant
Timeless elegant design with refined typography. Ideal for professional services and luxury brands.
  • Elegant typography
  • Refined layout
  • Professional appearance
  • Timeless design

Corporate Professional
Structured corporate design with clear sections. Best for B2B businesses and established companies.
  • Structured layout
  • Corporate styling
  • Clear sections
  • Business-focused

Creative Contemporary
Creative design with modern elements. Perfect for creative agencies and design-focused businesses.
  • Creative layout
  • Contemporary style
  • Unique design elements
  • Modern aesthetics

Modern Minimalist
Clean minimalist design with maximum white space. Ideal for modern brands and service businesses.
  • Minimalist design
  • Maximum white space
  • Clean typography
  • Modern simplicity

Refund Theme
Specialized template designed for refund invoices and credit notes with appropriate styling.
  • Refund-specific design
  • Clear refund indicators
  • Professional appearance
  • Credit note compatible
💡 Choosing the Right Template

Business Type Recommendations:

  • Retail & E-commerce: Default or Bold Modern
  • Professional Services: Classic Elegant or Corporate Professional
  • Creative Agencies: Creative Contemporary or Modern Minimalist
  • B2B Companies: Corporate Professional
  • Tech Startups: Bold Modern or Modern Minimalist

🔄
Switching Between Templates
1

Change Invoice Template

You can switch between templates at any time. The new template will apply to all newly generated invoices:

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Scroll to the "Template Settings" section
  3. Find the "Invoice Template" dropdown
  4. Select your desired template from the list:
    • Default
    • Bold Modern
    • Classic Elegant
    • Corporate Professional
    • Creative Contemporary
    • Modern Minimalist
    • Refund Theme
  5. Click "Save Changes"
  6. The new template will be used for all future invoices
Important Note

Changing the template only affects newly generated invoices. Existing invoices keep their original template. To update an existing invoice, you must regenerate it from the order page.

2

Regenerate Invoices with New Template

To update existing invoices with your new template:

  1. Change your template in the settings (as described above)
  2. Go to WooCommerce → Orders
  3. Open an order that already has an invoice
  4. In the Invoice meta box, click "Regenerate Invoice"
  5. The invoice will be recreated with the new template
  6. The invoice number remains the same
🔄 Bulk Regeneration

To regenerate multiple invoices at once:

  • Select orders on the Orders page
  • Use Bulk Actions → "Regenerate Invoices"
  • All selected orders will have their invoices recreated with the new template

👁️
Template Preview

Preview templates before applying them to see how they'll look with your data:

Method 1: Test Invoice Generation

  1. Select a template in the settings
  2. Save changes
  3. Create a test order with sample products
  4. Generate an invoice for the test order
  5. Download and review the PDF
  6. If not satisfied, select a different template and repeat

Method 2: Preview with Existing Orders

  1. Select a template in the settings
  2. Don't save yet
  3. Open a different browser tab
  4. Go to an existing order and regenerate its invoice
  5. Review the generated PDF
  6. If satisfied, return to settings and save
Best Practice

Always test templates with actual order data before finalizing your choice. Each template displays information slightly differently, so what looks good with one product layout may not work as well with another.

⚙️
Template Customization Options

Customize how templates display your information:

Company Branding

  • Company Logo: Appears in the header of all templates
  • Company Name: Displayed prominently at the top
  • Company Address: Shown in the invoice header
  • Contact Information: Phone, email, website included

Invoice Display Options

  • Product SKUs: Show/hide SKU codes in product listings
  • Product Images: Include product thumbnails (optional)
  • Tax Display: Show individual tax rates or totals
  • Payment Method: Display payment method used
  • Shipping Method: Show shipping method selected
  • Order Notes: Include customer order notes

Formatting Options

  • Paper Size: A4, Letter, Legal, A5
  • Date Format: Various date display formats
  • Currency Symbol: Position and format
  • Number Format: Decimal and thousand separators
⚙️ Accessing Customization Settings

All customization options are in:

WooCommerce → Settings → PDF Invoices → Template Settings

📋
Standard Information in All Templates

Regardless of which template you choose, all templates include:

Invoice Header

  • Company logo (if uploaded)
  • Company name and contact information
  • Invoice number and date
  • Order number and date

Customer Information

  • Billing address
  • Shipping address (if different)
  • Customer name and contact
  • Customer email and phone

Order Details

  • Product names and descriptions
  • Quantities ordered
  • Individual prices
  • Line item totals
  • Product variations and options

Totals Section

  • Subtotal
  • Shipping cost
  • Tax amounts (itemized)
  • Discounts/coupons applied
  • Grand total

Footer Information

  • Payment method
  • Tax/VAT number (if configured)
  • Additional notes or terms


Template Selection Best Practices

Tips for Choosing Your Template

  1. Match Your Brand: Choose a template that aligns with your brand identity and website design
  2. Consider Your Industry: Corporate templates for B2B, creative templates for agencies, clean templates for retail
  3. Test with Real Data: Generate invoices with various product types and order amounts
  4. Check Readability: Ensure all information is clearly visible and easy to read
  5. Print Testing: If customers print invoices, test how the template prints on paper
  6. Customer Feedback: Ask customers which format they find most professional
  7. Consistency: Once chosen, stick with one template for consistency
Avoid Frequent Changes

Changing templates frequently can confuse customers and create inconsistency in your records. Choose a template and use it for at least a full fiscal year before changing.

🎨 Template Selection Complete!

You now understand all 7 available invoice templates and how to switch between them. Choose the template that best represents your brand and start generating professional invoices!

Next: Proceed to Section 06: Email Attachments to learn how to automatically attach invoices to your WooCommerce order emails.

Email Attachments

Section 06

Email Attachments

Automatically attach invoices to WooCommerce order notification emails

🤖 Automation

🎯 What You'll Learn: Configure automatic invoice attachment to WooCommerce emails, choose which email types should include invoices, test email functionality, and troubleshoot common email delivery issues.

📧
WooCommerce Email Types

WooCommerce sends various email notifications during the order lifecycle. The plugin can automatically attach invoices to these emails:

Email Type When Sent Recommendation
New Order Sent to store admin when a new order is received Optional
Customer Processing Order Sent to customer when order status changes to Processing (payment received) Recommended
Customer Completed Order Sent to customer when order is marked as Completed Recommended
Customer On-Hold Order Sent to customer when order is placed on hold (awaiting payment) Optional
Customer Refunded Order Sent to customer when an order is fully or partially refunded Recommended
Cancelled Order Sent to customer when order is cancelled Optional
💡 Recommended Configuration

For most stores, attach invoices to:

  • ✓ Customer Processing Order - Provides invoice immediately after payment
  • ✓ Customer Completed Order - Confirms final invoice with delivery
  • ✓ Customer Refunded Order - Includes credit note for refunds

⚙️
Configure Automatic Attachments
1

Access Email Settings

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Look for the "Email Attachment Settings" section
  3. This section controls which emails include invoice attachments
2

Select Email Types

Choose which email notifications should automatically include invoices:

  1. In the Email Attachment Settings section
  2. You'll see checkboxes for each email type
  3. Check the boxes for emails that should include invoices:
    • ☐ New Order (to admin)
    • ☑ Customer Processing Order (recommended)
    • ☑ Customer Completed Order (recommended)
    • ☐ Customer On-Hold Order
    • ☑ Customer Refunded Order (recommended)
    • ☐ Cancelled Order
  4. Click "Save Changes"
Important Considerations

Don't attach invoices to every email:

  • Attaching to "On-Hold" emails may confuse customers (order not confirmed yet)
  • Attaching to "Cancelled" emails is unnecessary (order cancelled)
  • Admin "New Order" emails don't need customer invoices
3

Configure Attachment Behavior

Additional email attachment options:

Generate Invoice Before Email

Enable this option to ensure invoices are generated before email is sent:

  • "Generate invoice before sending email"
  • This creates the invoice automatically if it doesn't exist
  • Prevents emails being sent without invoice attachments
  • Recommended: Enabled

Attachment File Name

Configure how invoice files are named in emails:

  • Default: invoice-[order-number].pdf
  • Example: invoice-12345.pdf
  • The file name format is automatically set by the plugin
Recommended Setup

Enable these settings:

  • ✓ Attach to Customer Processing Order
  • ✓ Attach to Customer Completed Order
  • ✓ Attach to Customer Refunded Order
  • ✓ Generate invoice before sending email

🧪
Testing Email Attachments
4

Test Email Functionality

Always test email attachments before going live:

Method 1: Place Test Order

  1. Configure your email attachment settings
  2. Save all changes
  3. Place a test order on your store
  4. Use your own email address as the customer
  5. Complete the payment (use test mode if available)
  6. Check your email inbox for the Processing Order email
  7. Verify the invoice PDF is attached
  8. Download and open the attachment to verify content

Method 2: Resend Existing Order Email

  1. Go to WooCommerce → Orders
  2. Open an existing order
  3. In the Order Actions dropdown, select "Resend customer processing order notification"
  4. Click "Go"
  5. Check the customer's email (or your test email)
  6. Verify the invoice is attached
✓ What to Check
  • Email arrives in inbox (not spam folder)
  • PDF file is attached
  • File opens correctly
  • Invoice contains correct order information
  • Company logo and branding appears
  • All order details are accurate

🔧
Troubleshooting Email Issues

Common Issues and Solutions

Issue: Emails not arriving at all

Solutions:

  • Check WooCommerce email settings are configured correctly
  • Verify your hosting allows email sending
  • Check spam/junk folders
  • Use an SMTP plugin (like WP Mail SMTP)
  • Contact your hosting provider about email delivery

Issue: Emails arrive but no invoice attached

Solutions:

  • Verify email attachment settings are enabled and saved
  • Check that "Generate invoice before sending" is enabled
  • Ensure the invoice was generated for the order
  • Check server file permissions on /wp-content/uploads/
  • Verify server has write permissions

Issue: Attachment is corrupted or won't open

Solutions:

  • Check server PHP memory limit (increase to 256MB)
  • Verify PDF generator library is working correctly
  • Regenerate the invoice from the order page
  • Check for plugin conflicts (deactivate other PDF plugins)
  • Test with a different email client

Issue: Emails going to spam folder

Solutions:

  • Use an SMTP email service (SendGrid, Mailgun, etc.)
  • Set up SPF and DKIM records for your domain
  • Reduce PDF file size (optimize logo images)
  • Use a professional email address (not generic Gmail)
  • Test with different email providers

Issue: Large PDF files causing email issues

Solutions:

  • Compress your company logo image
  • Disable product images in invoices
  • Use a simpler template
  • Increase server max attachment size
  • Consider email service with higher attachment limits
Email Server Limitations

Most email servers have attachment size limits (typically 10-25MB). Keep invoice PDFs under 5MB for best deliverability.


Email Attachment Best Practices

Recommendations for Optimal Email Delivery

  1. Use SMTP Service: Install WP Mail SMTP or similar plugin for reliable email delivery
  2. Optimize File Size: Keep invoices under 2MB by optimizing images
  3. Test Regularly: Send test orders monthly to verify email functionality
  4. Monitor Deliverability: Check if customers are receiving invoices
  5. Backup Option: Include invoice download link in email text
  6. Professional Email: Use your domain email (@yourstore.com)
  7. Selective Attachment: Only attach to relevant emails (Processing, Completed)
💡 Pro Tips
  • Enable automatic invoice generation to ensure invoices exist before emails send
  • Test with multiple email providers (Gmail, Outlook, Yahoo)
  • Keep invoice templates simple to reduce file size
  • Use transactional email services for business-critical emails
  • Monitor email logs to track delivery issues

📧 Email Attachments Configured!

Your invoices are now automatically attached to WooCommerce order emails. Customers will receive professional PDF invoices without any manual intervention!

Next: Proceed to Section 07: Credit Note Generation to learn how to automatically create credit notes for refunded orders.

Credit Note Generation

Section 07

Credit Note Generation

Automatically create credit notes for refunded orders with professional formatting

💳 2 Templates Available

🎯 What You'll Learn: Generate professional credit notes for refunded orders, understand automatic and manual credit note creation, configure credit note numbering, and select from 2 specialized templates designed for refund documentation.

📖
Understanding Credit Notes

Credit notes are official documents issued when an order is refunded. They serve as proof of the refund and are essential for accounting and tax compliance.

What is a Credit Note?

  • Legal document showing amount refunded to customer
  • References the original invoice number
  • Contains details of items refunded
  • Required for accounting and tax purposes
  • Provides clear refund audit trail

When Credit Notes Are Issued

  • Full Refunds: Complete order refund
  • Partial Refunds: Some items or amounts refunded
  • Restocking: Items returned to inventory
  • Order Cancellations: After payment processed
💡 Credit Notes vs Invoices

Invoice: Documents money owed by customer
Credit Note: Documents money owed to customer (refund)

Credit notes have negative amounts and reference original invoice numbers.

🔄
Automatic Credit Note Generation
1

Enable Automatic Generation

Configure the plugin to automatically create credit notes when orders are refunded:

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Scroll to "Credit Note Settings" section
  3. Find "Automatic Credit Note Generation" option
  4. Check the box to enable automatic generation
  5. Click "Save Changes"
How It Works

When enabled, the plugin monitors your orders for refunds. When you process a refund in WooCommerce:

  • ✓ Credit note is automatically generated
  • ✓ Credit note number is assigned
  • ✓ PDF is created and saved
  • ✓ Credit note is attached to the order
  • ✓ Can be included in refund notification email
2

Automatic Generation Process

When you refund an order, the credit note is automatically created:

  1. Open an order in WooCommerce → Orders
  2. Click the "Refund" button
  3. Enter refund amount or select items to refund
  4. Add refund reason (optional)
  5. Click "Refund via [payment method]"
  6. WooCommerce processes the refund
  7. Plugin automatically generates credit note
  8. Credit note appears in order details
📋 What's Included in Credit Note
  • Original invoice number reference
  • Credit note number
  • Refund date
  • Items refunded with quantities
  • Refund amount (negative values)
  • Reason for refund
  • Company and customer information


Manual Credit Note Creation
3

Generate Credit Note Manually

You can manually generate credit notes for refunded orders:

  1. Go to WooCommerce → Orders
  2. Open an order that has been refunded
  3. In Order Actions dropdown, select "Generate Credit Note"
  4. Click "Go" button
  5. Credit note PDF is generated and downloaded
  6. Credit note information is saved to the order

When to Use Manual Generation

  • Automatic generation was disabled when refund was processed
  • Need to regenerate credit note after changes
  • Creating credit note for old refunded orders
  • Credit note generation failed automatically
Requirements

To manually generate a credit note:

  • Order must have a refund processed
  • Original invoice should exist (recommended)
  • Refund details must be present in order

🔢
Credit Note Numbering

Credit notes use a separate numbering system from invoices:

Numbering Format

  • Prefix: Configure custom prefix (e.g., CN- or CREDIT-)
  • Sequential Number: Automatic increment (001, 002, 003...)
  • Suffix: Optional suffix for categorization
  • Year/Month: Include date components if desired

Configure Credit Note Numbering

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Find "Credit Note Numbering" section
  3. Set Credit Note Prefix (e.g., CN-)
  4. Configure number format: {prefix}{year}{increment}
  5. Set starting number (default: 1)
  6. Click "Save Changes"
📝 Numbering Examples
  • CN-2024-001 (prefix + year + sequential)
  • CREDIT-00001 (prefix + sequential)
  • CN-202412-001 (prefix + year/month + sequential)
  • CR-2024/001 (prefix + year/sequential with separator)
Important

Credit note numbers are independent from invoice numbers. Use a different prefix to distinguish them clearly (e.g., INV- for invoices, CN- for credit notes).

🎨
Credit Note Templates

The plugin includes 2 specialized templates for credit notes:

1. Default Credit Note Template

Standard professional credit note design with clear refund information:

  • Clean layout matching default invoice style
  • Clear "CREDIT NOTE" header
  • Reference to original invoice number
  • Negative amounts clearly displayed
  • Professional appearance for all business types
2. Red Theme Credit Note Template

Distinctive red-themed design that stands out:

  • Red color scheme for easy identification
  • Bold "CREDIT NOTE" branding
  • Clear refund indication with colored elements
  • Matches "Refund Theme" invoice template
  • Visually distinct from regular invoices

Select Credit Note Template

  1. Go to WooCommerce → Settings → PDF Invoices
  2. Find "Credit Note Template" dropdown
  3. Select either:
    • Default - Standard professional style
    • Red Theme - Distinctive red design
  4. Click "Save Changes"
  5. Future credit notes will use the selected template
Recommendation

Use Red Theme if: You want credit notes to be immediately visually distinct from invoices in accounting and filing systems.

Use Default if: You prefer consistent styling across all documents or have strict brand guidelines.

📥
Accessing Credit Notes

Access and download credit notes from multiple locations:

From Order Details Page

  1. Open the refunded order
  2. Look for the "Credit Note" meta box
  3. Click "Download Credit Note" button
  4. PDF downloads to your computer

From Order Actions

  1. Open the order
  2. Use Order Actions → Download Credit Note
  3. Click "Go"
  4. Credit note PDF downloads

Customer Access

Customers can download credit notes from their account:

  • My Account → Orders
  • View order details
  • Click "Download Credit Note" link
  • PDF opens or downloads
📧 Email Delivery

Credit notes can be automatically attached to refund notification emails. Configure this in Email Attachment Settings (Section 06).


Credit Note Best Practices

Professional Credit Note Management

  1. Always Enable Automatic Generation: Ensures every refund has proper documentation
  2. Keep Original Invoices: Credit notes reference original invoice numbers
  3. Use Clear Prefixes: Distinguish credit notes from invoices (CN- vs INV-)
  4. Include Refund Reasons: Document why refund was issued
  5. Send to Customers: Attach credit notes to refund emails
  6. Archive Properly: File credit notes with corresponding invoices
  7. Maintain Sequential Numbering: Never skip or duplicate numbers
Compliance Note

Many jurisdictions require credit notes for refunds for tax and accounting compliance. Always issue credit notes for refunded transactions to maintain proper financial records.

💳 Credit Notes Configured!

You now have automated credit note generation for all refunded orders, ensuring complete financial documentation and compliance.

Next: Proceed to Section 08: Shipping Label Generation to learn how to create professional shipping labels for your orders.

Shipping Label Generation

Section 08

Shipping Label Generation

Create and print professional shipping labels with multiple template styles

📦 6 Templates • Print Ready

🎯 What You'll Learn: Generate professional shipping labels for your orders, choose from 6 different label template styles, customize label content, print labels for shipping, and use bulk generation for multiple orders.

📖
About Shipping Labels

Shipping labels are essential documents attached to packages containing delivery information:

What's Included in Shipping Labels

  • Recipient Address: Customer's shipping address
  • Sender Address: Your business/warehouse address
  • Order Information: Order number and date
  • Label Number: Unique tracking identifier
  • Barcode/QR Code: Scannable tracking code (optional)
  • Package Details: Weight, dimensions (if configured)

Why Use Shipping Labels

  • Ensures accurate delivery addresses
  • Professional appearance for packages
  • Includes tracking and identification
  • Speeds up warehouse fulfillment process
  • Reduces shipping errors
🚚 Integration with Carriers

These labels are for package identification and address display. They work alongside carrier-specific labels (USPS, FedEx, UPS) by providing clear order and address information on your packages.

🎨
Available Label Templates

Choose from 6 professionally designed shipping label templates:

Default Label
Standard shipping label with clear sections for sender, recipient, and order information. Works with all label sizes.
Classic Label
Traditional shipping label design with bold headers and structured layout. Professional appearance for all business types.
Minimalist Label
Clean, simple design with maximum white space. Modern appearance with essential information only.
Premium Label
Sophisticated label design with elegant typography and refined layout. Ideal for premium brands.
Professional Label
Business-focused design with clear sections and strong visual hierarchy. Perfect for B2B shipments.
Default Original
Original default template with traditional layout. Maintained for compatibility with existing workflows.

📄
Generate Shipping Labels
1

Generate Label for Single Order

Create a shipping label for any order:

  1. Go to WooCommerce → Orders
  2. Open the order needing a shipping label
  3. In Order Actions dropdown, select "Generate Shipping Label"
  4. Click "Go" button
  5. Label PDF is generated and downloaded
  6. Label number is assigned automatically
  7. Label information is saved to the order
Label Generated

The shipping label PDF contains all address and order information formatted for your selected template and label size. Ready to print and attach to your package!

2

Access Generated Labels

Download and access shipping labels:

From Order Page

  • Open the order details
  • Look for "Shipping Label" meta box
  • Click "Download Label" button
  • PDF downloads to your computer

From Order Actions

  • Use Order Actions dropdown
  • Select "Download Shipping Label"
  • Click "Go"
  • Label PDF downloads

Regenerate Labels

If shipping address changes after label generation:

  1. Update the shipping address in the order
  2. Use Order Actions → "Generate Shipping Label"
  3. New label is created with updated information
  4. Label number remains the same


Bulk Label Generation
3

Generate Labels for Multiple Orders

Process multiple shipping labels at once:

  1. Go to WooCommerce → Orders
  2. Select multiple orders using checkboxes
  3. In Bulk Actions dropdown, select "Generate Shipping Labels"
  4. Click "Apply"
  5. Labels are generated for all selected orders
  6. Success message shows how many labels were created
💡 Bulk Generation Tips
  • Process up to 50 orders at a time
  • Labels with existing labels are skipped
  • Download labels individually from each order
  • Use bulk generation at end of day for all pending shipments

Filter Orders for Label Generation

Generate labels for specific order groups:

  • Filter by status: Processing orders ready to ship
  • Filter by date: Today's orders or specific date range
  • Filter by shipping method: Specific carriers
  • Select filtered results and bulk generate

🖨️
Print Shipping Labels

Shipping labels are optimized for printing on standard label paper or regular paper:

Printing Options

  • Label Sheets: Print on adhesive label sheets (4x6" or A6)
  • Regular Paper: Print and tape to packages
  • Thermal Printers: Direct thermal printing support

How to Print

  1. Download the shipping label PDF
  2. Open the PDF in your PDF viewer
  3. Click Print or press Ctrl+P (Cmd+P on Mac)
  4. Select your printer
  5. Choose print settings:
    • Paper Size: Match your label size (4x6", A6, etc.)
    • Scale: 100% (actual size)
    • Orientation: Portrait or Landscape (template dependent)
  6. Click Print
  7. Attach label to package
Print Settings

Important: Always print at 100% scale (actual size). Scaling can cause barcodes to become unscannable and addresses to be incorrectly sized.

🖨️ Recommended Printers
  • Thermal Label Printers: DYMO, Zebra, Rollo (best for high volume)
  • Laser Printers: Good quality for label sheets
  • Inkjet Printers: Use waterproof labels

⚙️
Label Customization

Customize shipping label content and appearance:

Select Label Template

  1. Go to WooCommerce → Settings → PDF Invoices → Shipping Labels
  2. Find "Label Template" dropdown
  3. Select from 6 available templates
  4. Click "Save Changes"

Company Information on Labels

Your company information (sender address) appears on all labels:

  • Uses company details from plugin settings
  • Update in: WooCommerce → Settings → PDF Invoices
  • Includes: Company name, address, phone, email

Additional Label Options

  • Include Order Number: Display order number prominently
  • Include Order Date: Show when order was placed
  • Include Barcode: Add scannable tracking barcode
  • Include QR Code: Add QR code for mobile scanning

Configure these options in Shipping Label Settings (Section 09).


Shipping Label Best Practices

Efficient Label Workflow

  1. Bulk Generate: Generate all day's labels at once
  2. Verify Addresses: Check shipping addresses before generating
  3. Print Immediately: Generate and print labels during packing
  4. Use Barcodes: Enable barcodes for warehouse scanning
  5. Consistent Template: Use same template for all shipments
  6. Quality Paper: Use waterproof or durable label stock
  7. Test Printing: Test with one label before bulk printing
Recommended Workflow
  1. Process orders and update to Processing status
  2. Filter orders by Processing status
  3. Bulk generate shipping labels for all
  4. Print all labels in one batch
  5. Pack orders with labels attached
  6. Update orders to Completed/Shipped

📦 Shipping Labels Ready!

You can now generate professional shipping labels for all your orders with just a few clicks!

Next: Proceed to Section 09: Shipping Label Settings to customize label templates, sizes, and barcode options.

Shipping Label Settings
Section 09

Shipping Label Settings

Configure shipping label preferences including templates, paper sizes, and barcode options

Overview

The Shipping Label Settings allow you to configure how shipping labels are generated and displayed for your WooCommerce orders. These settings control label templates, paper formats, numbering systems, and barcode/QR code integration.

📍 Location: WooCommerce → Settings → Shipping Labels tab

General Settings

Setting Options Description
Enable Shipping Labels Yes/No (checkbox) Master switch to enable or disable the shipping label generation feature
Generate Labels For Order Statuses Multiple selection Select which order statuses should allow label generation (default: Processing, Shipped, Completed)

Label Format Configuration

Paper Size & Orientation

Setting Available Options Default
Label Paper Size 4x6 inches (Standard)
4x4 inches (Square)
A6 (105x148mm)
4x6 inches
Label Orientation • Portrait
• Landscape
Portrait
💡 Recommended: Use 4x6 inches portrait for standard thermal printers and shipping label compatibility with major carriers (USPS, FedEx, UPS).

Template Selection

Choose from available shipping label templates. Templates are PHP files located in templates/shipping-label-*.php

Template Filename Pattern
Default shipping-label-default.php
Modern shipping-label-modern.php
Classic shipping-label-classic.php
🎨 Template Preview: Use the live preview button in settings to see how your selected template will look before generating actual labels.

Label Numbering System

Number Format Configuration

Configure custom label numbering using format placeholders:

Placeholder Output Example
{Y} 4-digit year 2025
{M} 2-digit month 12
{D} 2-digit day 02
{NNNN} Sequential number (4 digits, padded) 0001, 0042, 1523
{NNN} Sequential number (3 digits, padded) 001, 042, 523
{NN} Sequential number (2 digits, padded) 01, 42, 99
{N} Sequential number (no padding) 1, 42, 523
{ORDER_ID} WooCommerce order ID 12345
{ORDER_NUMBER} WooCommerce order number ORD-2025-001

Example Formats

Format String Example Output Use Case
SHIP-{Y}{M}{D}-{NNNN} SHIP-20251202-0001 Default format (recommended)
LBL-{Y}-{NNNN} LBL-2025-0042 Year-based tracking
SHIP-{ORDER_NUMBER} SHIP-12345 Order ID based labels

Prefix & Suffix

Setting Description Example
Label Number Prefix Text added before the format (optional) PREFIX- → PREFIX-SHIP-20251202-0001
Label Number Suffix Text added after the format (optional) -SUFFIX → SHIP-20251202-0001-SUFFIX

Barcode & QR Code Settings

Barcode Configuration

Setting Options Description
Show Barcode Yes/No (checkbox) Display tracking barcode section on labels (default: Yes)
Barcode Type Code 128 (Standard)
Simple Pattern
Choose barcode format for tracking numbers
📊 Code 128: Industry-standard barcode format compatible with most barcode scanners. Supports alphanumeric characters and is widely used in shipping and logistics.

QR Code Configuration

QR Content Type Description Example Data
Store URL + Order + Tracking Recommended Creates tracking link to your store yoursite.com?order=123&tracking=TN456&key=abc
Direct Order Tracking URL Direct link to order tracking page yoursite.com/my-account/orders/123
Store URL Only Simple link to your store homepage yoursite.com
Complete JSON Data Full order data in JSON format {"order":"123","tracking":"TN456",...}
vCard Contact Info Store contact information as vCard Store name, address, phone, email
1
Use Google QR Codes (checkbox, default: Yes)
Uses Google Charts API for high-quality, scannable QR codes. Recommended for production use.
✅ Best Practice: Enable "Use Google QR Codes" for maximum compatibility with all QR scanner apps (smartphones, dedicated scanners, etc.).

Return Address Configuration

Configure the default return/sender address displayed on all shipping labels:

Field Required Default
Company Name Yes Your site name
Address Line 1 Yes -
Address Line 2 No -
City Yes -
State/Province Yes -
Postal Code Yes -
Country Yes Store base country
Phone Number No -

Package Information

Setting Description Default
Default Package Weight (lbs) Fallback weight when product weight is not available 2 lbs
Default Package Dimensions Default package size (e.g., "12 x 10 x 4 inches") 12 x 10 x 4 inches

Email Attachment Settings

Automatic Email Attachments

1
Attach to Emails: Enable automatic attachment of shipping labels to order emails (checkbox)
2
Email Types for Labels: Select which email types should include shipping labels (multiselect)
  • Order Processing (Customer)
  • Order Completed (Customer)
  • Order Shipped (Customer)
⚠️ Important: Labels will only attach to emails if a label has already been generated for the order. Labels are not auto-generated; they must be created manually or via bulk actions first.

Company Logo Upload

1
Company Logo URL: Enter the full URL of your logo image (text field)
2
Upload Button: Click "Upload Logo" to select and upload a logo from your computer (button opens media library)
📐 Recommended Size: 200 x 100 pixels (PNG format recommended for transparency)

Label Preview

The settings page includes a live preview of your shipping label design:

  • Preview updates dynamically as you change settings
  • Shows selected template with current configuration
  • Displays barcode and QR code placement
  • Verifies logo display and return address formatting
💡 Tip: Always preview your labels after changing templates or major settings before generating labels for actual orders.

Saving Settings

1
Configure all desired settings on the Shipping Labels tab
2
Click "Save Changes" button at the bottom of the page
3
Settings are immediately applied to all new label generations
⚠️ Note: Existing generated labels are not updated when settings change. To apply new settings to old orders, regenerate their labels.
Bulk Operations
Section 10

Bulk Operations

Generate multiple invoices/labels at once and perform bulk operations efficiently

Overview Time Saver

Bulk Operations allow you to process multiple orders simultaneously, saving hours of manual work. Generate invoices, create shipping labels, and download documents for hundreds of orders with just a few clicks.

📍 Access Points:
• WooCommerce → Orders (bulk action dropdown)
• WooCommerce → PDF Invoices → Bulk Generation
• Individual order edit screens

Bulk Invoice Generation

From Orders List

1
Navigate to WooCommerce → Orders
2
Select multiple orders using checkboxes (check boxes next to order numbers)
3
From the "Bulk Actions" dropdown at the top, select:
Generate Invoices
4
Click "Apply" button
5
View completion notice showing:
• Number of invoices generated
• Number of orders skipped (already had invoices)
• Number of errors (if any)
✅ Smart Skipping: The plugin automatically skips orders that already have invoices, preventing duplicates and wasted processing time.

From Dedicated Bulk Page

1
Navigate to WooCommerce → PDF Invoices → Bulk Operations
2
Set filter criteria:
  • Date From: Start date (date picker)
  • Date To: End date (date picker)
  • Order Status: Select one or more statuses (multiselect dropdown)
3
Click "Preview Orders" to see which orders will be processed
4
Review the order preview table showing:
  • Order ID and number
  • Customer name
  • Order status
  • Order date
  • Invoice status (✓ has invoice or "Pending")
5
Click "Generate Invoices" to process all orders
💡 Preview First: Always use the preview feature to verify you're generating invoices for the correct orders before processing.

Bulk Download as ZIP

Download Multiple Invoices

1
Go to WooCommerce → Orders
2
Select orders with existing invoices (checkboxes)
3
Choose Download Invoices (ZIP) from Bulk Actions dropdown
4
Click "Apply"
5
ZIP file automatically downloads containing all invoice PDFs, named:
invoices-[date-range].zip

ZIP File Structure

Each PDF inside the ZIP is named using the format:

invoice-[invoice-number]-[order-id].pdf
✅ Example: invoice-INV-2025-001-12345.pdf
⚠️ Requirements: Orders must already have generated invoices. If no invoices exist, the system will show "No invoices found for selected orders."

Download Shipping Labels as ZIP

Same process as invoices, but select Download Labels (ZIP) from the Bulk Actions dropdown.

ZIP filename format: shipping-labels-[date-from]-to-[date-to].zip

Individual label filenames: label-[order-id]-[label-number].pdf

Bulk Email Sending

1
Select orders from WooCommerce → Orders
2
Choose Email Invoices to Customers from Bulk Actions
3
Click "Apply"
4
Invoices are automatically emailed to customers as PDF attachments
📧 Email Details:
• Sent to customer's billing email address
• Invoice PDF attached automatically
• Uses WooCommerce email templates
• Subject: "Your Invoice for Order #[order-number]"
⚠️ Prerequisites:
• Orders must have valid customer email addresses
• Invoices must already be generated
• WooCommerce email system must be configured

Date Range Selection

Filter orders by creation date for targeted bulk operations:

Using Date Filters

1
Date From: Click the date picker and select start date
2
Date To: Click the date picker and select end date
3
Date format: YYYY-MM-DD (e.g., 2025-12-01)
4
Leave dates blank to include all orders (no date filtering)
💡 Common Use Cases:
• Generate invoices for last month's orders
• Download all labels for today's shipments
• Email invoices for orders from specific date range

Order Status Filtering

Available Status Filters

Select which order statuses to include in bulk operations:

  • Pending Payment
  • Processing
  • On Hold
  • Completed
  • Cancelled
  • Refunded
  • Failed
  • Custom statuses (if added by other plugins)

Multiple Status Selection

1
Click the "Order Status" multiselect dropdown
2
Check one or more statuses to include
3
Selected statuses appear as badges in the dropdown
4
Leave unselected to include ALL order statuses
💡 Recommended Filters:
Invoices: "Processing" and "Completed" statuses
Shipping Labels: "Processing" and "Shipped" statuses
Credit Notes: "Refunded" status only

Bulk Shipping Label Operations

Generate Labels in Bulk

1
Navigate to Bulk Operations page
2
Set date range and order status filters
3
Click "Preview Orders" button
4
Review preview table showing label status for each order
5
Click "Generate Shipping Labels" button
6
View completion summary:
  • Generated: New labels created
  • Skipped: Orders already had labels
  • Errors: Failed generations (with reasons)

Bulk Download Labels

Download all shipping labels for a date range as a single ZIP file:

1
Set date filters (From/To dates)
2
Select order statuses to include
3
Click "Download Labels (ZIP)"
4
ZIP file downloads automatically with all available labels
⚠️ Note: Only orders with existing shipping labels will be included in the ZIP. If no labels exist, you'll see "No shipping labels found for selected orders."

Performance & Limitations

Processing Speed

  • Typical speed: 2-5 orders per second
  • Large batches (100+ orders) may take 30-60 seconds
  • Progress displayed in real-time
  • Operations run in background (page won't freeze)

Recommended Batch Sizes

Operation Recommended Max Reason
Invoice Generation 500 orders PDF generation is memory-intensive
Shipping Label Generation 300 orders Barcode/QR generation adds processing time
Bulk Email Sending 100 orders Email server rate limits
ZIP Download 1000 files ZIP file size and browser limits
💡 Tip: For very large batches (1000+ orders), split into multiple smaller operations using date range filters.

Error Handling

Common Errors & Solutions

Error Message Cause Solution
"No orders found" No orders match the selected criteria Adjust date range or status filters
"No invoices found" Selected orders don't have invoices yet Generate invoices first, then download
"Failed to create ZIP" Server permission or disk space issue Check server permissions on uploads folder
"Email sending failed" SMTP/email configuration issue Verify WooCommerce email settings
✅ Auto-Recovery: If some orders fail, the system continues processing others and provides a detailed error report at the end.
Barcode & QR Code Integration
Section 11

Barcode & QR Code Integration

Add barcodes and QR codes to your invoices and shipping labels for tracking

Overview Tracking

The plugin generates industry-standard barcodes and QR codes automatically on invoices and shipping labels. These codes enable quick scanning for order lookup, tracking, and inventory management.

📍 Configuration: WooCommerce → Settings → Shipping Labels → Barcode & QR Code Settings

Barcode Support

Enable/Disable Barcodes

1
Navigate to WooCommerce → Settings → Shipping Labels
2
Locate the "Show Barcode" checkbox setting
3
Check to display barcodes on shipping labels
Uncheck to hide barcodes
4
Click "Save Changes"
✅ Default: Barcodes are enabled by default (recommended for tracking and scanning functionality).

Barcode Formats

Available Barcode Types

Barcode Type Description Use Case
Code 128 Standard Industry-standard high-density barcode supporting full ASCII character set • Shipping carriers (UPS, FedEx, USPS)
• Tracking numbers
• Order numbers
• Professional barcode scanning
Simple Pattern Basic visual pattern for simple recognition • Internal use only
• Visual identification
• Non-critical scanning

Code 128 Technical Details

  • Supports: All ASCII characters (A-Z, a-z, 0-9, special characters)
  • Density: High (compact barcode)
  • Checksum: Automatic error detection built-in
  • Standard: ISO/IEC 15417
  • Compatibility: All standard barcode scanners
💡 Recommendation: Use Code 128 for production environments. It's universally compatible with barcode scanners and shipping carrier systems.

Barcode Configuration

Select Barcode Type

1
Go to Shipping Labels Settings
2
Find "Barcode Type" dropdown setting
3
Select desired barcode format:
  • Code 128 (Standard) - Recommended
  • Simple Pattern - Basic visual pattern
4
Save changes

What Gets Encoded in Barcodes

The plugin automatically encodes the following information in barcodes:

Document Type Encoded Data Example
Shipping Labels Custom tracking number (if set) or label number TN123456789 or SHIP-20251202-0001
Invoices Invoice number INV-2025-001
Credit Notes Credit note number CN-2025-001

QR Code Integration

QR Code Content Types

Configure what information is encoded in QR codes on shipping labels:

Content Type Description Example Output
Store URL + Order + Tracking Recommended Creates a tracking link customers can scan to view order status https://yoursite.com?order=123&tracking=TN456&key=abc123
Direct Order Tracking URL Direct link to WooCommerce order view page https://yoursite.com/my-account/orders/123
Store URL Only Simple link to your store homepage https://yoursite.com
Complete JSON Data Full order information in JSON format (for apps/integrations) {"order":"123","tracking":"TN456","status":"shipped"}
vCard Contact Info Store contact information in vCard format (adds to phone contacts) Store name, address, phone, email in vCard format

Select QR Code Content

1
Navigate to Shipping Labels Settings
2
Find "QR Code Content" dropdown
3
Select desired content type from the dropdown
4
Review the "QR Code Preview" section to see what will be encoded
5
Save changes
✅ Best Practice: Use "Store URL + Order + Tracking" for customer-facing labels. Customers can scan with their smartphones to instantly track packages.

QR Code Generation Methods

Google Charts API (Recommended)

1
Check the "Use Google QR Codes" checkbox (enabled by default)
2
QR codes are generated using Google Charts API
3
Results in high-quality, universally scannable QR codes

Google QR vs. Local Generation

Feature Google Charts API Local Generation
Quality ⭐⭐⭐⭐⭐ Excellent ⭐⭐⭐ Good
Scan Success Rate 99%+ on all devices 85-95% depending on printer
File Size Optimized, smaller Larger
Internet Required Yes (during generation) No
Recommended For Production, customer-facing Internal use, offline
💡 Recommendation: Keep "Use Google QR Codes" enabled for best results. The Google Charts API generates crisp, high-contrast QR codes that scan reliably on all smartphone cameras.

Placement on Documents

Shipping Labels

  • QR Code: Top right corner of label
  • Barcode: Bottom section above tracking number
  • Both appear below shipping address
  • Size: Automatically scaled to label dimensions

Invoices

  • Barcode: Footer section (invoice number encoded)
  • QR Code: Not included on invoices by default
  • Positioned for easy scanning without interfering with text
⚠️ Template Dependency: Exact placement depends on your selected template. Preview templates to verify barcode/QR code positions before printing.

Tracking Workflow

How QR Tracking Works

1
Label Generation: QR code created with tracking URL
2
Customer Scans: Uses smartphone camera or QR scanner app
3
Redirect: Plugin intercepts the URL and validates order + key
4
Display: Customer sees order tracking page with shipment status
🔒 Security: The plugin includes a secure key in QR tracking URLs to prevent unauthorized order access. Only customers with the correct key can view order details.

Barcode Scanning Workflow

1
Scan barcode with barcode scanner (handheld or integrated)
2
Scanner reads encoded tracking number or label number
3
Use decoded number to search orders in WooCommerce admin
4
Quickly locate and update order status

Testing Barcodes & QR Codes

Test Before Production

1
Generate a test shipping label or invoice
2
Print the document using your actual printer
3
Test QR Code: Scan with multiple smartphones (iOS & Android)
4
Test Barcode: Scan with your barcode scanner equipment
5
Verify decoded data matches expected values

Troubleshooting Scan Issues

Problem Cause Solution
QR code won't scan Low print quality or small size • Enable "Use Google QR Codes"
• Increase label paper size
• Check printer DPI settings
Barcode scan errors Incorrect barcode type or damaged print • Switch to Code 128 format
• Clean printer heads
• Use higher quality label paper
QR redirects to wrong page QR content type misconfigured • Select "Store URL + Order + Tracking"
• Regenerate labels after changing settings
✅ Print Quality Matters: Use 300+ DPI printer settings and quality thermal label paper for best barcode/QR scanning results.

Compatibility

Supported Devices

  • Smartphones: iPhone (iOS 11+), Android (Camera app with QR support)
  • Barcode Scanners: Any Code 128 compatible scanner (Honeywell, Symbol, Zebra, etc.)
  • Tablets: iPad, Android tablets with camera
  • Dedicated QR Scanners: All standard QR code readers

Printer Compatibility

  • Thermal label printers (Zebra, Dymo, Rollo, Brother)
  • Standard inkjet/laser printers
  • Commercial shipping label printers
📱 No App Required: QR codes work with native smartphone cameras on modern iOS and Android devices. Customers don't need to download special apps.
Order Management Interface
Section 12

Order Management Interface

Manage invoices and labels directly from the WooCommerce orders screen with quick actions

Overview Admin Interface

The Order Management Interface integrates seamlessly into WooCommerce's native orders screen, adding PDF invoice and shipping label actions directly to each order. Manage documents without leaving the orders page.

📍 Location: WooCommerce → Orders (order list and individual order edit screens)

Order Actions Dropdown

Accessing Order Actions

1
Go to WooCommerce → Orders
2
Hover over any order row in the orders list
3
Click the dropdown arrow (⋮) or hover to reveal quick actions
4
See available PDF actions for that specific order

Available Invoice Actions

Action When Visible Function
Generate Invoice Order has NO invoice yet Creates new invoice for the order
Download Invoice Invoice already exists Downloads existing invoice PDF
Regenerate Invoice Invoice already exists Regenerates invoice with current data (overwrites old PDF)
Email Invoice Invoice already exists Sends invoice PDF to customer's email

Available Shipping Label Actions

Action When Visible Function
Generate Label Order has NO label yet Creates new shipping label for the order
View Label Label already exists Opens label PDF in browser for preview
Download Label Label already exists Downloads label PDF to computer
Regenerate Label Label already exists Regenerates label with current settings (overwrites old PDF)

Credit Note Actions

Action When Visible Function
Download Credit Note Order has refunds Downloads credit note PDF for the refund
✅ Smart Actions: The plugin automatically shows only relevant actions based on order status and existing documents. You'll never see "Generate Invoice" if one already exists.

Invoice Meta Boxes (Sidebar)

Accessing Invoice Meta Box

1
Open any order by clicking on it from the orders list
2
Look at the right sidebar of the order edit screen
3
Find the "PDF Invoice Actions" meta box (high priority, near top)

Invoice Meta Box Content

When invoice EXISTS:

  • Invoice Number: Displays the generated invoice number (e.g., INV-2025-001)
  • Invoice Date: Shows invoice generation date (formatted as "Month Day, Year")
  • Action Buttons:
    • 📥 Download Invoice - Downloads PDF
    • 🔄 Regenerate Invoice - Creates new PDF with latest data
    • 📧 Email to Customer - Sends invoice via email

When invoice does NOT exist:

  • Message: "No invoice generated yet"
  • Single button: Generate Invoice

When PDF file is missing (but invoice number exists):

  • Shows invoice number and date
  • Warning: "PDF file missing"
  • Button: Regenerate Invoice to recreate the PDF
💡 Quick Access: The meta box provides instant access to all invoice operations without scrolling through the entire order page.

Shipping Label Meta Box

Label Information Display

When label EXISTS:

  • Label Number: Shows generated label number (e.g., SHIP-20251202-0001)
  • Generated Date: Timestamp of when label was created
  • Tracking Number: Custom tracking number if set
  • Courier Name: Shipping carrier name if specified
  • Action Buttons:
    • 👁️ View Label - Preview in browser
    • 📥 Download Label - Download PDF
    • 🔄 Regenerate Label - Create new label

When label does NOT exist:

  • Message: "No shipping label generated yet"
  • Button: Generate Label

Tracking Information Section

The meta box includes a dedicated section for managing tracking details:

Field Description Action
Tracking Number Text input for courier tracking number Editable - enter carrier's tracking ID
Courier Name Text input for shipping carrier Editable - enter carrier name (e.g., "UPS", "FedEx")
Tracking Link (URL) Full tracking URL from carrier Optional - direct link to carrier tracking page
1
Enter tracking details in the respective fields
2
Click "Save Tracking Info" button
3
Information is saved to order meta and displayed in meta box

Send Tracking Email

After saving tracking information, you can notify the customer:

1
Ensure tracking number and courier are saved
2
Click "Send Tracking Email to Customer" button
3
Email sent with tracking details and link (if provided)
4
Meta box displays confirmation: "Tracking email sent on [date & time]"
✅ Email Tracking: The system remembers when tracking emails were sent, preventing duplicate notifications to customers.

Credit Note Meta Box

Credit Note Display

When order has refunds:

Each refund is displayed with the following information:

  • Credit Note Number: If generated (e.g., CN-2025-001)
  • Refund Date: When the refund was created
  • Refund Amount: Total amount refunded (formatted with currency)
  • Status: "Pending" if credit note not generated yet

Action Buttons:

  • 📄 Generate Credit Note (if not yet generated)
  • 📥 Download Credit Note (if already generated)
📋 Multiple Refunds: If an order has multiple refunds, each refund gets its own credit note entry in the meta box with separate download buttons.

Quick Actions Summary

One-Click Operations

Document Type Quick Actions Available
Invoice • Generate
• Download
• Regenerate
• Email to Customer
Shipping Label • Generate
• View (preview)
• Download
• Regenerate
Credit Note • Generate
• Download
Tracking • Update tracking info
• Send tracking email

Invoice Status Indicators

Visual Indicators in Orders List

The plugin adds visual status indicators to quickly identify document status:

Indicator Meaning Location
✓ Invoice icon Invoice exists and PDF is available Order row hover state / actions column
📦 Label icon Shipping label exists Order row hover state / actions column
⚠️ Warning icon Invoice number exists but PDF file missing Meta box and order details
"Pending" text Credit note not yet generated for refund Credit note meta box
💡 At-a-Glance Status: Quickly scan your orders list to see which orders have invoices/labels without opening each order individually.

Regenerate Operations

When to Regenerate Documents

Use the regenerate function in these scenarios:

  • Order information changed: Customer updated address, products modified, etc.
  • Template updated: You changed invoice/label templates in settings
  • Company info changed: Updated logo, address, or contact details
  • PDF file missing: File was accidentally deleted from server
  • Numbering format changed: Want to apply new numbering format (note: number itself stays the same)

Regenerate Process

1
Click "Regenerate Invoice" or "Regenerate Label"
2
Plugin fetches current order data and plugin settings
3
New PDF generated with updated information
4
Old PDF file overwritten (same invoice/label number retained)
5
Success message displayed: "Invoice/Label regenerated successfully"
⚠️ Important: Regenerating does NOT change the invoice/label number. It only recreates the PDF with current data using the existing number.

Admin Notices & Feedback

Success Messages

  • "Invoice generated successfully!"
  • "Invoice regenerated successfully!"
  • "Invoice has been emailed to the customer."
  • "Shipping label generated successfully!"
  • "Tracking information saved and email sent to customer."

Error Messages

  • "Error generating invoice. Please try again."
  • "Failed to send email. Check email configuration."
  • "Could not generate shipping label. Missing required address information."
  • "Security check failed. Please refresh and try again."
✅ User Feedback: All operations provide immediate visual feedback via WordPress admin notices at the top of the screen, confirming success or explaining errors.

Permission Requirements

Required Capabilities

Action Required Permission
View order actions manage_woocommerce
Generate/download invoices manage_woocommerce
Generate/download labels manage_woocommerce
Send emails to customers manage_woocommerce
👤 User Roles: Only users with Shop Manager or Administrator roles can access PDF invoice and shipping label actions.
Plugin Settings Panel
Section 13

Plugin Settings Panel

Complete walkthrough of all plugin settings and configuration options

Overview Complete Reference

The Plugin Settings Panel provides centralized access to all PDF Invoices Pro configuration options. All settings are organized into logical tabs within WooCommerce's settings interface.

📍 Access: WooCommerce → Settings → PDF Invoices tab
Additional: WooCommerce → Settings → Shipping Labels tab

General Settings

Core Features

Setting Type Default Description
Enable Invoices Checkbox Yes Master switch to enable/disable invoice generation feature
Enable Credit Notes Checkbox Yes Generate credit notes automatically when orders are refunded
Enable Shipping Labels Checkbox No Enable shipping label generation feature (in Shipping Labels tab)

Company Information

Field Type Description
Company Name Text Your business name (appears on invoices and labels)
Company Address Textarea Full company address (multi-line)
Company Phone Text Contact phone number
Company Email Email Contact email address
Tax/VAT Number Text Business tax ID or VAT registration number
Company Website URL Your website URL

Logo Upload

1
Company Logo URL: Enter direct URL to logo image, or use upload button
2
Click "Upload Logo" to open WordPress media library
3
Select existing image or upload new one
4
Logo URL automatically populated
5
Logo Preview: Shows current logo below upload section
📐 Recommended: 200-400px wide, PNG format with transparent background for best results.

Invoice Settings

Invoice Generation

Setting Options Description
Automatic Invoice Generation Yes/No (checkbox) Automatically generate invoices when orders reach specified statuses
Generate Invoice On Status Multiselect Select order statuses that trigger automatic invoice generation (default: Processing, Completed)

Invoice Numbering

Setting Example Description
Invoice Number Format {prefix}{year}{month}{increment} Template for invoice numbering using placeholders
Invoice Prefix INV- Text added before invoice number
Invoice Suffix -US Text added after invoice number
Starting Number 1 or 1001 First invoice number in sequence
Reset Counter Button Reset invoice counter to starting number

Display Options

Setting Type Description
Date Format Select Choose date display format (Y-m-d, d/m/Y, m/d/Y, etc.)
Paper Size Select A4, Letter, Legal
Display Prices Including Tax Checkbox Show prices with tax included vs. tax separate
Show SKU Checkbox Display product SKUs on invoices
Show Product Thumbnails Checkbox Include small product images on invoices

Payment Information

Setting Description
Payment Terms Free text for payment terms (e.g., "Payment due within 30 days")
Bank Account Details Bank name, account number, routing number (for bank transfer payments)
Additional Notes Footer text displayed on all invoices (e.g., "Thank you for your business!")

Email Settings

Automatic Email Attachments

Setting Type Description
Attach Invoice to Emails Checkbox Automatically attach invoice PDF to customer emails
Email Types Multiselect Select which email types should include invoice attachment:
• Customer invoice/order details
• Order processing
• Order completed
• Customer note
📧 Note: Invoices are only attached if they already exist. If automatic generation is disabled, invoices must be manually generated first.

Template Settings

Invoice Templates

Setting Description
Invoice Template Select from available templates:
• Default
• Modern
• Classic
• Minimal
• Professional
(Templates are PHP files in templates/ folder)
Template Preview Live preview buttons:
• 📄 Preview as PDF - Opens full PDF in browser
• 🐛 Preview as HTML - Debug view (HTML source)

Color Customization

Setting Type Description
Primary Color Color picker Main brand color for headers and accents
Secondary Color Color picker Secondary color for borders and table headers
Text Color Color picker Primary text color
💡 Live Preview: After changing any template or color settings, click "Preview as PDF" to see changes before saving.

Advanced Options

PDF Generation Settings

Setting Options Description
PDF Engine DomPDF (default) PDF generation library used by plugin
Font Select dropdown Default font for PDFs:
• Arial
• Helvetica
• Times
• Courier
Font Size Number (px) Base font size (default: 12px)

File Storage

Setting Description
Storage Location PDFs stored in: /wp-content/uploads/wc-pdf-invoices-pro/
Auto-Cleanup Automatically delete PDFs older than X days (optional)
Number input (default: disabled)
Cleanup Orphaned Files Button to manually remove PDF files for deleted orders

Credit Note Settings

Setting Description
Credit Note Prefix Prefix for credit note numbers (default: "CN-")
Credit Note Format Numbering format for credit notes (same placeholders as invoices)
Starting Number First credit note number in sequence

Debug Mode

Developer Tools

Setting Function
Enable Debug Mode Checkbox to enable detailed error logging
Log Location Logs written to: /wp-content/uploads/wc-pdf-invoices-pro/logs/
View Log Button to view recent error logs in browser
Clear Log Button to delete all log files
⚠️ Performance Impact: Debug mode writes extensive logs and should only be enabled for troubleshooting. Disable after debugging to maintain performance.

System Information

Debug section displays useful system information:

  • Plugin version
  • WordPress version
  • WooCommerce version
  • PHP version and memory limit
  • DomPDF version
  • Upload directory path and permissions
  • Database table status

Saving Settings

1
Make changes to any settings in the panel
2
Scroll to bottom of settings page
3
Click "Save Changes" button
4
Success message appears: "Your settings have been saved"
5
Settings immediately applied to all new document generations
💾 Auto-Save: There is no auto-save. Always click "Save Changes" before leaving the settings page or your changes will be lost.

Settings Backup & Reset

Export Settings

1
Scroll to "Tools" section in settings
2
Click "Export Settings" button
3
JSON file downloads with all current settings

Import Settings

1
Click "Choose File" button in Tools section
2
Select previously exported JSON file
3
Click "Import Settings" button
4
Settings restored from backup file

Reset to Defaults

1
Click "Reset to Defaults" button in Tools section
2
Confirmation prompt appears
3
Confirm to reset all settings to factory defaults
⚠️ Warning: Reset to Defaults will erase ALL custom settings. Export your settings first if you want to restore them later.

Quick Reference: Settings Locations

Setting Category Location
Invoice generation, company info, templates WooCommerce → Settings → PDF Invoices
Shipping labels, barcodes, QR codes WooCommerce → Settings → Shipping Labels
Bulk operations interface WooCommerce → PDF Invoices → Bulk Operations
Order-specific actions WooCommerce → Orders → (individual order edit screen)
Customer Access to Invoices
Section 14

Customer Access to Invoices

Enable customers to download their invoices from their account area

Overview Customer Features

The plugin automatically integrates invoice download functionality into WooCommerce's customer-facing areas. Customers can access their invoices through multiple touchpoints without admin access.

📍 Customer Access Points:
• My Account → Orders page
• Individual order view pages
• Email download links

My Account Integration

Orders List View

Customers see invoice download buttons directly on their orders list:

1
Customer logs into their account on your site
2
Navigates to My Account → Orders
3
Each order row displays available actions:
• View
• Pay (if unpaid)
Download Invoice (if invoice exists)
4
Click "Download Invoice" button
5
Invoice PDF downloads immediately to customer's device

Button Display Logic

Condition Button Visibility
Invoice exists for order "Download Invoice" button visible
No invoice generated yet ❌ No invoice button shown
Order status = Pending Payment ❌ No invoice button (invoice generated after payment)
Order refunded (credit note exists) ✅ Invoice button + separate credit note access
✅ User-Friendly: Customers only see download buttons when invoices are actually available, preventing confusion and support requests.

Order View Page

Individual Order Details

1
Customer clicks "View" button on any order in My Account
2
Full order details page loads
3
Invoice download link appears in dedicated section:
"Invoice:" Download Invoice (INV-2025-001)
4
Click download link to get PDF

Display Format

The invoice link appears as a prominent, styled element:

  • Label: "Invoice:" or custom text
  • Link Text: "Download Invoice ([invoice-number])"
  • Icon: 📄 PDF icon (optional, theme-dependent)
  • Position: Below order items, above customer details
🎨 Styling: Invoice links inherit your theme's button/link styles and are responsive for mobile devices.

Email Download Links

Automatic Email Integration

When email attachments are enabled in settings, customers receive invoices via two methods:

Method 1: PDF Attachment

  • Invoice PDF attached directly to order emails
  • Customer can save attachment to device
  • Works with all email clients (Gmail, Outlook, Apple Mail, etc.)
  • No login required to access

Method 2: Download Link in Email

  • Secure download link included in email body
  • Customer clicks link to download invoice
  • Link includes authentication key for security
  • No separate login required if accessed from customer's registered email
✅ Dual Access: Providing both attachment and link ensures customers can access invoices even if email providers block PDF attachments.

Email Types with Invoice Access

Email Type Invoice Access Configurable
Order Processing PDF attachment + download link Yes (in Email Settings)
Order Completed PDF attachment + download link Yes (in Email Settings)
Customer Invoice PDF attachment + download link Yes (in Email Settings)
Customer Note Download link only (optional) Yes (in Email Settings)

Frontend Display Customization

Customizing Button Text

Developers can customize customer-facing text using WordPress filters:

add_filter('wc_pdf_invoice_download_text', function($text) { return 'Get Your Invoice PDF'; });

Customizing Link Styling

Add custom CSS to your theme to style invoice download links:

.wc-pdf-invoice-download-link { background: #0073aa; color: white; padding: 10px 20px; border-radius: 4px; }
🎨 Theme Compatibility: The plugin uses standard WooCommerce action hooks, ensuring compatibility with all properly coded WooCommerce themes.

Security & Permissions

Access Control

Scenario Access Granted? Security Mechanism
Logged-in customer views own order ✅ Yes WordPress user ID verification
Guest tries to access order via direct URL ❌ No Login redirect
Customer A tries to access Customer B's invoice ❌ No Order ownership verification
Download link from email (with key) ✅ Yes Secure key validation
Admin/Shop Manager ✅ Yes (all orders) User capability check

Secure Download URLs

All customer download links include security tokens:

https://yoursite.com/admin-ajax.php?action=wc_pdf_invoice_download&order_id=123&_wpnonce=abc123xyz
  • Nonce Verification: WordPress nonce prevents CSRF attacks
  • Order Ownership: Plugin verifies customer owns the order
  • Expiration: Nonces expire after 24 hours
  • IP Validation: Optional IP-based access control
🔒 Privacy Compliant: Invoice access logging available for GDPR compliance audits.

Guest Checkout Handling

Guest Orders (No Account)

For customers who checkout as guests:

1
Invoice PDF automatically attached to order confirmation email
2
Email includes secure download link (works without login)
3
Customer can download from email link or attachment
4
No My Account access (guest has no account)
⚠️ Guest Limitations: Guest customers cannot access invoices from My Account (no account exists). They must use email links/attachments.

Order Lookup for Guests

Guests can use WooCommerce's order lookup feature:

1
Customer visits My Account → Orders → "Order Lookup"
2
Enters order number + email address
3
Order details page loads with invoice download link
4
Can download invoice without creating account

Mobile Responsiveness

Mobile Device Access

  • Smartphone: Download buttons fully responsive and touch-friendly
  • Tablet: Optimized layout for medium screens
  • PDF Viewing: PDFs open in native mobile viewers (iOS Safari, Chrome, etc.)
  • Download to Device: Customers can save PDFs to phone/tablet storage

Email Client Compatibility

Email Client PDF Attachment Download Link
Gmail (Web & App) ✅ Supported ✅ Works
Outlook / Hotmail ✅ Supported ✅ Works
Apple Mail (iOS/Mac) ✅ Supported ✅ Works
Yahoo Mail ✅ Supported ✅ Works
ProtonMail ✅ Supported ✅ Works

Troubleshooting Customer Access

Common Issues & Solutions

Issue Cause Solution
No download button visible Invoice not generated yet Admin must generate invoice first (or enable automatic generation)
"Access denied" error Customer trying to access another customer's invoice Ensure customer is logged in with correct account
Download link expired Security nonce expired (24+ hours old) Customer should request new link from My Account
PDF won't open PDF corrupted or device doesn't support PDF Regenerate invoice PDF; recommend PDF viewer app
Email attachment missing Email attachment not enabled in settings Enable "Attach Invoice to Emails" in plugin settings

Customer Support Tips

Help Your Customers Find Invoices

Add clear instructions to your site's FAQ or help section:

📋 Sample Customer Instructions:

"How to Download Your Invoice"

Method 1 - My Account:
1. Log into your account
2. Go to My Account → Orders
3. Find your order and click "Download Invoice"

Method 2 - Email:
1. Check your order confirmation email
2. Download the attached PDF file, or
3. Click the "Download Invoice" link in the email

Need help? Contact our support team.
Template Customization
Section 15

Template Customization

Advanced guide for developers to create and customize invoice templates

Overview Developers Advanced

The plugin uses a flexible PHP-based template system that allows complete customization of invoice and shipping label designs. Templates can be overridden in your theme, customized via filters, and extended with custom functionality.

🎯 Prerequisites:
• PHP knowledge (intermediate to advanced)
• Understanding of WordPress template hierarchy
• Familiarity with WooCommerce order objects
• Basic HTML/CSS for PDF styling

Template Structure

Plugin Template Locations

Template Type Plugin Location File Pattern
Invoices /templates/invoice/ {template-name}.php
Credit Notes /templates/credit-note/ {template-name}.php
Shipping Labels /templates/ shipping-label-{name}.php

Default Templates Included

  • default.php - Standard invoice template
  • modern.php - Contemporary design with bold headers
  • classic.php - Traditional invoice layout
  • minimal.php - Clean, minimalist design
  • shipping-label-default.php - Standard 4x6 shipping label

Theme Override System

Override in Child Theme

The plugin automatically checks for template overrides in your theme:

1
Create directory structure in your theme:
/wp-content/themes/your-theme/woocommerce/pdf-invoices/
2
Copy template from plugin to theme:
From: plugins/wc-pdf-invoices-pro/templates/invoice/default.php
To: themes/your-theme/woocommerce/pdf-invoices/default.php
3
Edit the theme copy - your changes are now update-safe
✅ Best Practice: Always use theme overrides instead of editing plugin files directly. This ensures your customizations survive plugin updates.

Template Hierarchy

The plugin searches for templates in this order:

1. Child Theme: /child-theme/woocommerce/pdf-invoices/{template}.php 2. Parent Theme: /parent-theme/woocommerce/pdf-invoices/{template}.php 3. Plugin: /plugins/wc-pdf-invoices-pro/templates/invoice/{template}.php 4. Fallback: /plugins/wc-pdf-invoices-pro/templates/invoice/default.php
💡 Tip: Use locate_template() WordPress function - the plugin handles this automatically via WC_Template_Manager::get_invoice_template()

Available Variables

Invoice Template Variables

All variables are automatically available in templates via extract():

Variable Type Description
$order WC_Order Full WooCommerce order object with all methods available
$invoice_number string Generated invoice number (e.g., "INV-2025-001")
$invoice_date string Invoice generation date/time (MySQL format)
$company_name string Company name from plugin settings
$company_address string Full company address
$company_phone string Company phone number
$company_email string Company email address
$company_website string Company website URL
$company_logo string Full URL to company logo image
$header_text string Custom header text from settings
$footer_text string Custom footer text from settings
$invoice_terms string Payment terms and conditions
$settings array Complete plugin settings array for custom logic
$is_preview boolean True when generating preview (no real order data)

Credit Note Template Variables

Variable Type Description
$refund WC_Order_Refund WooCommerce refund object
$order WC_Order Parent order object
$credit_note_number string Generated credit note number
$credit_note_date string Credit note generation date
$original_invoice_number string Invoice number of the original order
📚 Reference: All company variables ($company_*) are also available in credit note templates.

Creating Custom Templates

Basic Template Structure

Minimal invoice template example:

<?php /** * Custom Invoice Template * * Available vars: $order, $invoice_number, $invoice_date, $company_name, etc. */ // Prevent direct access if (!defined('ABSPATH')) exit; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> body { font-family: Arial, sans-serif; font-size: 12px; } .header { text-align: center; margin-bottom: 30px; } .invoice-details { margin: 20px 0; } .items-table { width: 100%; border-collapse: collapse; } .items-table th { background: #f5f5f5; padding: 8px; } .items-table td { padding: 8px; border-bottom: 1px solid #ddd; } </style> </head> <body> <div class="header"> <?php if ($company_logo): ?> <img src="<?php echo esc_url($company_logo); ?>" width="200"> <?php endif; ?> <h1><?php echo esc_html($company_name); ?></h1> </div> <div class="invoice-details"> <strong>Invoice #:</strong> <?php echo esc_html($invoice_number); ?><br> <strong>Date:</strong> <?php echo esc_html(wp_date('F j, Y', strtotime($invoice_date))); ?> </div> <?php if ($order): ?> <h3>Bill To:</h3> <p> <?php echo esc_html($order->get_billing_first_name() . ' ' . $order->get_billing_last_name()); ?><br> <?php echo esc_html($order->get_billing_address_1()); ?><br> <?php if ($order->get_billing_address_2()): ?> <?php echo esc_html($order->get_billing_address_2()); ?><br> <?php endif; ?> <?php echo esc_html($order->get_billing_city() . ', ' . $order->get_billing_state() . ' ' . $order->get_billing_postcode()); ?> </p> <table class="items-table"> <thead> <tr> <th>Item</th> <th>Qty</th> <th>Price</th> <th>Total</th> </tr> </thead> <tbody> <?php foreach ($order->get_items() as $item): ?> <tr> <td><?php echo esc_html($item->get_name()); ?></td> <td><?php echo esc_html($item->get_quantity()); ?></td> <td><?php echo wc_price($item->get_subtotal() / $item->get_quantity()); ?></td> <td><?php echo wc_price($item->get_total()); ?></td> </tr> <?php endforeach; ?> </tbody> </table> <div style="text-align: right; margin-top: 20px;"> <strong>Total: <?php echo $order->get_formatted_order_total(); ?></strong> </div> <?php endif; ?> <?php if ($footer_text): ?> <div style="margin-top: 40px; font-size: 10px; color: #666;"> <?php echo wp_kses_post($footer_text); ?> </div> <?php endif; ?> </body> </html>
⚠️ Important: Always escape output using esc_html(), esc_url(), or wp_kses_post() for security.

Template Best Practices

  • Use inline CSS styles (external stylesheets don't work in PDFs)
  • Avoid complex CSS (position: fixed, flexbox, grid are poorly supported)
  • Use tables for layout instead of divs with floats
  • Keep images small and use absolute URLs
  • Test extensively - DomPDF has CSS limitations
  • Use web-safe fonts or embed custom fonts
  • Validate HTML structure for PDF rendering

Template Hooks and Filters

Modifying Template Data (Filter)

Add or modify variables available in templates:

add_filter('wc_pdf_invoices_pro_template_data', function($data, $template_file) { // Add custom variable $data['custom_field'] = 'Custom Value'; // Modify existing variable if (isset($data['order'])) { $data['custom_order_info'] = 'Order #' . $data['order']->get_id(); } // Conditional based on template if (strpos($template_file, 'modern.php') !== false) { $data['use_bold_headers'] = true; } return $data; }, 10, 2);

Modifying Rendered HTML (Filter)

Modify the final HTML before PDF generation:

add_filter('wc_pdf_invoices_pro_template_html', function($html, $data, $template_file) { // Add watermark if (isset($data['order']) && $data['order']->get_status() === 'pending') { $html = str_replace('<body>', '<body><div class="watermark">UNPAID</div>', $html ); } // Replace placeholders $html = str_replace('{CUSTOM_TEXT}', 'Replaced Content', $html); return $html; }, 10, 3);

Available Filter Hooks

Hook Name Parameters Purpose
wc_pdf_invoices_pro_template_data $data, $template_file Modify variables before template rendering
wc_pdf_invoices_pro_template_html $html, $data, $template_file Modify final HTML after template rendering
wc_shipping_label_settings $settings Add custom shipping label settings fields

PDF-Specific Styling

Supported CSS Properties

DomPDF (the PDF library) supports a subset of CSS 2.1:

Supported ✅ Limited Support ⚠️ Not Supported ❌
• font-family, font-size, font-weight
• color, background-color
• margin, padding
• border, border-collapse
• text-align, text-decoration
• width, height
• page-break-before/after
• float (basic only)
• position: relative
• background-image
• line-height
• opacity
• position: fixed/sticky
• flexbox, grid
• transform, transition
• box-shadow, text-shadow
• @media queries
• CSS animations

Page Break Control

<style> /* Force page break before element */ .new-page { page-break-before: always; } /* Prevent page break inside element */ .keep-together { page-break-inside: avoid; } /* Force page break after element */ .break-after { page-break-after: always; } </style> <div class="keep-together"> <!-- This content stays on one page --> </div>

Custom Fonts

To use custom fonts in PDFs, fonts must be added to DomPDF's font directory. Contact support for font installation assistance.

Child Theme Integration

Complete Child Theme Setup

1
Create directory: /wp-content/themes/your-child-theme/woocommerce/pdf-invoices/
2
Copy template files you want to customize
3
Add custom functions to functions.php:
// Add custom invoice variables add_filter('wc_pdf_invoices_pro_template_data', 'my_custom_invoice_data', 10, 2); function my_custom_invoice_data($data, $template_file) { if (isset($data['order'])) { // Add custom order meta $data['shipping_method'] = $data['order']->get_shipping_method(); $data['payment_method'] = $data['order']->get_payment_method_title(); // Add custom calculations $data['items_count'] = $data['order']->get_item_count(); } return $data; } // Modify PDF settings add_filter('wc_pdf_invoices_pro_paper_size', 'my_custom_paper_size'); function my_custom_paper_size($size) { return 'LETTER'; // Change from A4 to Letter }

Available Helper Functions

Use these plugin-provided helper functions in templates:

Function Returns Description
wc_pdf_invoices_format_price($amount) string Format price with currency symbol
wc_pdf_invoices_format_date($date) string Format date according to plugin settings
wc_pdf_invoices_get_setting($key) mixed Get specific plugin setting value

Testing & Debugging Templates

Use Preview Mode

1
Go to WooCommerce → Settings → PDF Invoices
2
Select your custom template from dropdown
3
Click "Preview as HTML" to see raw HTML output
4
Click "Preview as PDF" to see rendered PDF

Debug Mode

Enable debug mode in plugin settings to log template rendering errors:

// Check if preview mode if ($is_preview) { echo '<!-- Preview Mode Active -->'; } // Debug output (only in HTML preview, removed in PDF) if (WP_DEBUG) { error_log('Template variables: ' . print_r($data, true)); }
✅ Pro Tip: Use HTML preview mode to quickly iterate on designs without generating full PDFs. Once satisfied, test with actual order data using "Preview as PDF".
Hooks & Filters Reference
Section 16

Hooks & Filters Reference

Complete developer reference for extending plugin functionality

Overview API Reference

The plugin provides a comprehensive set of action hooks and filters for developers to extend and customize functionality without modifying core plugin files. All hooks follow WordPress coding standards and are update-safe.

📖 Naming Convention:
• Actions: wc_pdf_invoice_* or wc_pdf_invoices_pro_*
• Filters: wc_pdf_invoices_pro_*
• Priority: Default 10 (higher = runs later)

Action Hooks

Invoice Generation Action

Hook Parameters When Fired
woocommerce_order_status_completed $order_id Order status changes to "Completed" (triggers invoice generation)
woocommerce_order_status_processing $order_id Order status changes to "Processing" (triggers invoice generation)
wc_pdf_invoice_saved_to_database $order_id, $number, $type, $refund_id, $file_path After invoice/credit note saved to database

Usage Examples

// Hook after invoice is saved add_action('wc_pdf_invoice_saved_to_database', 'my_custom_invoice_action', 10, 5); function my_custom_invoice_action($order_id, $number, $type, $refund_id, $file_path) { if ($type === 'invoice') { // Send to external accounting system my_send_to_accounting_api($order_id, $file_path); // Log for audit trail error_log("Invoice {$number} generated for order {$order_id}"); } } // Add custom action on order completion (before invoice generation) add_action('woocommerce_order_status_completed', 'my_pre_invoice_tasks', 5); function my_pre_invoice_tasks($order_id) { $order = wc_get_order($order_id); // Add custom order meta that will appear in invoice $order->update_meta_data('_invoice_notes', 'Express shipping applied'); $order->save(); }

Filter Hooks

Template & Display Filters Filter

Filter Parameters Purpose Return Type
wc_pdf_invoices_pro_template_data $data, $template_file Modify template variables before rendering array
wc_pdf_invoices_pro_template_html $html, $data, $template_file Modify final HTML before PDF generation string
wc_pdf_invoice_download_text $text Customize "Download Invoice" button text string

Settings Filters Filter

Filter Parameters Purpose Return Type
wc_shipping_label_settings $settings Add or modify shipping label settings array
woocommerce_my_account_my_orders_actions $actions, $order Add custom actions to My Account orders (including invoice download) array

Usage Examples

// Add custom template variable add_filter('wc_pdf_invoices_pro_template_data', 'add_custom_invoice_data', 10, 2); function add_custom_invoice_data($data, $template_file) { if (isset($data['order'])) { $order = $data['order']; // Add custom field $data['delivery_date'] = $order->get_meta('_delivery_date'); // Add calculated field $data['total_weight'] = 0; foreach ($order->get_items() as $item) { $product = $item->get_product(); if ($product) { $data['total_weight'] += $product->get_weight() * $item->get_quantity(); } } } return $data; } // Modify HTML to add watermark add_filter('wc_pdf_invoices_pro_template_html', 'add_invoice_watermark', 10, 3); function add_invoice_watermark($html, $data, $template_file) { // Only add watermark for unpaid orders if (isset($data['order']) && !$data['order']->is_paid()) { $watermark = '<div style="position: absolute; top: 50%; left: 50%; transform: rotate(-45deg); font-size: 72px; color: rgba(255,0,0,0.1); z-index: 9999;">UNPAID</div>'; $html = str_replace('<body>', '<body>' . $watermark, $html); } return $html; } // Customize download button text add_filter('wc_pdf_invoice_download_text', 'custom_download_text'); function custom_download_text($text) { return __('Get Your PDF Invoice', 'your-textdomain'); }

Custom Functionality Examples

Example 1: Send Invoice to External API

add_action('wc_pdf_invoice_saved_to_database', 'send_invoice_to_api', 10, 5); function send_invoice_to_api($order_id, $number, $type, $refund_id, $file_path) { if ($type !== 'invoice') { return; // Only handle invoices, not credit notes } $order = wc_get_order($order_id); if (!$order) { return; } // Prepare API payload $payload = array( 'invoice_number' => $number, 'order_id' => $order_id, 'customer_email' => $order->get_billing_email(), 'total' => $order->get_total(), 'currency' => $order->get_currency(), 'date' => current_time('Y-m-d H:i:s') ); // Send to external API $response = wp_remote_post('https://api.example.com/invoices', array( 'headers' => array('Authorization' => 'Bearer YOUR_API_KEY'), 'body' => json_encode($payload), 'timeout' => 30 )); // Log response if (is_wp_error($response)) { wc_pdf_invoices_log('API error: ' . $response->get_error_message(), 'error'); } else { wc_pdf_invoices_log('Invoice sent to API: ' . $number, 'info'); } }

Example 2: Conditional Invoice Generation

// Skip invoice generation for specific payment methods add_action('woocommerce_order_status_completed', 'conditional_invoice_generation', 5); function conditional_invoice_generation($order_id) { $order = wc_get_order($order_id); // Skip invoice for cash on delivery if ($order->get_payment_method() === 'cod') { // Remove the plugin's automatic generation hook remove_action('woocommerce_order_status_completed', array(WC_PDF_Invoices_Pro::get_instance(), 'generate_invoice_on_status_change')); } }

Example 3: Add Custom Invoice Numbering Logic

add_filter('wc_pdf_invoices_pro_template_data', 'custom_invoice_number', 10, 2); function custom_invoice_number($data, $template_file) { if (isset($data['order']) && isset($data['invoice_number'])) { $order = $data['order']; // Add country code to invoice number $country = $order->get_billing_country(); $data['invoice_number'] = $country . '-' . $data['invoice_number']; // Add payment method prefix $payment_method = $order->get_payment_method(); if ($payment_method === 'stripe') { $data['invoice_number'] = 'CC-' . $data['invoice_number']; } } return $data; }

Example 4: Auto-Email Invoices to Admin

add_action('wc_pdf_invoice_saved_to_database', 'email_invoice_to_admin', 10, 5); function email_invoice_to_admin($order_id, $number, $type, $refund_id, $file_path) { if ($type !== 'invoice' || !file_exists($file_path)) { return; } $order = wc_get_order($order_id); if (!$order) { return; } // Send email to admin $admin_email = get_option('admin_email'); $subject = "New Invoice Generated: {$number}"; $message = "Invoice {$number} has been generated for order #{$order_id}.\n\n"; $message .= "Customer: {$order->get_billing_first_name()} {$order->get_billing_last_name()}\n"; $message .= "Total: {$order->get_formatted_order_total()}"; $attachments = array($file_path); wp_mail($admin_email, $subject, $message, '', $attachments); }

Integration with Other Plugins

WooCommerce Subscriptions Integration

// Generate invoice for subscription renewals add_action('woocommerce_subscription_renewal_payment_complete', 'generate_subscription_invoice'); function generate_subscription_invoice($subscription) { // Get the renewal order $orders = $subscription->get_related_orders('all', 'renewal'); if (empty($orders)) { return; } $order_id = reset($orders); // Generate invoice wc_pdf_invoices_generate_invoice($order_id); }

Advanced Custom Fields (ACF) Integration

// Add ACF fields to invoice add_filter('wc_pdf_invoices_pro_template_data', 'add_acf_to_invoice', 10, 2); function add_acf_to_invoice($data, $template_file) { if (isset($data['order'])) { $order_id = $data['order']->get_id(); // Add ACF fields from order $data['custom_field_1'] = get_field('custom_field_1', $order_id); $data['custom_field_2'] = get_field('custom_field_2', $order_id); // Add ACF fields from products $custom_product_info = array(); foreach ($data['order']->get_items() as $item) { $product_id = $item->get_product_id(); $custom_product_info[$product_id] = get_field('extra_info', $product_id); } $data['product_custom_info'] = $custom_product_info; } return $data; }

WooCommerce Bookings Integration

// Add booking details to invoice add_filter('wc_pdf_invoices_pro_template_data', 'add_booking_to_invoice', 10, 2); function add_booking_to_invoice($data, $template_file) { if (isset($data['order'])) { $booking_ids = WC_Booking_Data_Store::get_booking_ids_from_order_id($data['order']->get_id()); if (!empty($booking_ids)) { $bookings = array(); foreach ($booking_ids as $booking_id) { $booking = get_wc_booking($booking_id); $bookings[] = array( 'start' => $booking->get_start_date(), 'end' => $booking->get_end_date(), 'persons' => $booking->get_persons(), 'resource' => $booking->get_resource()->get_name() ); } $data['bookings'] = $bookings; } } return $data; }

Helper Functions

Available Global Functions

Function Parameters Returns Description
wc_pdf_invoices_generate_invoice() $order_id string|false Generate invoice for order, returns file path or false
wc_pdf_invoices_order_has_invoice() $order_id boolean Check if order has invoice generated
wc_pdf_invoices_get_invoice_number() $order_id string Get invoice number for order
wc_pdf_invoices_format_price() $amount, $order string Format price with currency symbol
wc_pdf_invoices_format_date() $date, $format string Format date according to plugin settings
wc_pdf_invoices_get_setting() $key, $default mixed Get specific plugin setting value
wc_pdf_invoices_log() $message, $level void Write to plugin error log ($level: 'info', 'warning', 'error')

Usage Examples

// Programmatically generate invoice $file_path = wc_pdf_invoices_generate_invoice(12345); if ($file_path) { echo "Invoice generated: {$file_path}"; } else { echo "Failed to generate invoice"; } // Check invoice status if (wc_pdf_invoices_order_has_invoice(12345)) { $invoice_number = wc_pdf_invoices_get_invoice_number(12345); echo "Invoice Number: {$invoice_number}"; } // Format price $order = wc_get_order(12345); echo wc_pdf_invoices_format_price(99.99, $order); // Outputs: $99.99 // Log custom message wc_pdf_invoices_log('Custom integration triggered', 'info');

Best Practices

✅ Do's:
• Always check if objects/arrays exist before accessing them
• Use proper WordPress escaping functions in templates
• Test with debug mode enabled during development
• Use appropriate hook priorities to control execution order
• Document your custom code for future maintenance
• Return the expected data type from filters
• Use wc_pdf_invoices_log() for debugging
⚠️ Don'ts:
• Don't modify plugin files directly (use hooks/filters instead)
• Don't assume order objects always exist (check with if ($order))
• Don't perform heavy operations in hooks (risk timeout)
• Don't break template rendering by returning incorrect types
• Don't forget to sanitize and escape user input
• Don't use deprecated WooCommerce functions
Order Management Interface
Section 17

Common Issues & Solutions

Troubleshooting guide for resolving common problems and errors

Overview Support

This guide covers the most frequently encountered issues with PDF Invoices Pro and their solutions. Follow the diagnostic steps for each problem category to quickly resolve issues.

🎯 Quick Diagnostic Checklist:
1. Check PHP version (7.4+ required)
2. Verify WordPress & WooCommerce are up to date
3. Ensure upload directory permissions are correct
4. Test with default WordPress theme
5. Disable other plugins temporarily

PDFs Not Generating Critical

Issue: No Invoice Generated After Order

Symptoms:
• "Generate Invoice" button appears (invoice hasn't been created)
• No invoice number in order meta
• No errors displayed

Solution Steps:

1
Check if automatic generation is enabled:
WooCommerce → Settings → PDF Invoices
Verify "Enable Invoices" checkbox is checked
2
Verify order status triggers:
Check "Generate Invoice On Status" setting includes the order's current status
3
Check PHP errors:
Enable WordPress debug mode in wp-config.php:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
Check /wp-content/debug.log for errors
4
Verify DomPDF library is loaded:
Run PDF generation test from Settings → Debug → "Test PDF Generation"

Issue: PDF File is 0 Bytes or Corrupted

Symptoms:
• Invoice number exists but PDF won't open
• File size shows as 0 bytes
• "PDF file missing" warning in order meta box

Common Causes & Solutions:

Cause Solution
PHP Memory Limit Too Low Increase memory limit in wp-config.php:
define('WP_MEMORY_LIMIT', '256M');
Or contact hosting provider to increase limit
PHP Max Execution Time Increase in .htaccess:
php_value max_execution_time 300
Or contact hosting provider
Template HTML Errors Preview as HTML (Settings → PDF Invoices → Preview as HTML)
Check browser console for JavaScript errors
Validate HTML structure
Missing Fonts DomPDF requires web-safe fonts (Arial, Helvetica, Times)
Check template doesn't use custom fonts without proper installation
Broken Logo URL Verify company logo URL is accessible (not local file path)
Use absolute URLs (http:// or https://)
Test logo URL in browser

Issue: DomPDF Class Not Found

Error Message:
Fatal error: Class 'Dompdf\Dompdf' not found
1
Verify /vendor/ directory exists in plugin folder
2
Check /vendor/autoload.php file exists
3
If missing, contact support for complete plugin package

Email Attachment Issues High Priority

Issue: Invoice Not Attached to Emails

Symptoms:
• Customer receives email but no PDF attachment
• Email shows invoice link but not attachment

Solution Steps:

1
Verify email attachment is enabled:
WooCommerce → Settings → PDF Invoices → Email Settings
Check "Attach Invoice to Emails" is enabled
2
Check email type configuration:
Verify correct email types are selected in "Email Types" multiselect
3
Confirm invoice exists before email sent:
Invoices are only attached if they already exist
Enable automatic generation or generate manually first
4
Check file permissions:
PDF file must be readable by web server:
chmod 644 /wp-content/uploads/wc-pdf-invoices-pro/invoices/*.pdf
5
Test with Gmail/Outlook:
Some email clients block PDF attachments
Ask customer to check spam/junk folder
Provide download link as alternative

Issue: Emails Not Sending at All

Diagnostic Action
Test WooCommerce emails work without plugin Deactivate PDF plugin temporarily and test order email
If still broken, it's a WooCommerce/SMTP issue, not plugin issue
Check email logs Use plugin like "WP Mail Logging" to see if emails are being sent
Check for bounce/rejection messages
SMTP Configuration Install "WP Mail SMTP" plugin for reliable email delivery
Configure with Gmail, SendGrid, or Mailgun
Server email limits Contact hosting provider about email sending limits
Shared hosting often restricts bulk emails

Template Display Problems Medium Priority

Issue: Template Styling Broken in PDF

Symptoms:
• HTML preview looks correct but PDF is broken
• Images missing or misaligned
• Tables overlapping text
• Colors not displaying

DomPDF CSS Limitations:

  • Use inline styles instead of external CSS files
  • Avoid flexbox/grid - use tables for layout
  • No position: fixed/sticky - use static or relative
  • Images must use absolute URLs (not relative paths)
  • No box-shadow or text-shadow
  • Float support is limited - test thoroughly

Debugging Template Issues:

1
Use HTML preview first:
Settings → PDF Invoices → Preview as HTML (Debug)
Check browser console for errors
2
Simplify CSS gradually:
Remove complex styles one by one until PDF renders
Identify which CSS property causes the issue
3
Validate HTML:
Use W3C validator (validator.w3.org)
Fix any structural errors

Issue: Logo Not Displaying

Check Fix
Logo URL format Must be absolute URL: https://yoursite.com/logo.png
NOT relative: /wp-content/uploads/logo.png
File accessibility Ensure logo URL is publicly accessible (not behind login)
Test by opening URL in incognito browser window
Image format PNG and JPG work best
SVG support is limited in DomPDF
File size Keep under 500KB for performance
Large images slow PDF generation
Remote loading Check "Enable Remote Content" is enabled in Advanced Settings

Permission Errors Critical

Issue: Cannot Write PDF File

Error Message:
Failed to write PDF file or Permission denied

Fix File Permissions:

1
Check upload directory exists:
/wp-content/uploads/wc-pdf-invoices-pro/
If missing, plugin should create it automatically
2
Set correct permissions via FTP/SSH:
# For directories chmod 755 /wp-content/uploads/wc-pdf-invoices-pro/ chmod 755 /wp-content/uploads/wc-pdf-invoices-pro/invoices/ chmod 755 /wp-content/uploads/wc-pdf-invoices-pro/shipping-labels/ # For files (after generated) chmod 644 /wp-content/uploads/wc-pdf-invoices-pro/invoices/*.pdf
3
Check ownership:
Files must be owned by web server user (often www-data or apache)
chown -R www-data:www-data /wp-content/uploads/wc-pdf-invoices-pro/
4
Test write permissions:
Settings → Debug → "Test PDF Generation"
If test fails, contact hosting support

Issue: Access Denied When Downloading

Error Message:
Access denied or You do not have permission

Check User Permissions:

User Type Required Capability Solution
Admin / Shop Manager manage_woocommerce Should work automatically
If not, check user role hasn't been modified
Customer (logged in) Order ownership Customer can only download invoices for their own orders
Verify correct customer is logged in
Guest Valid email link Must use secure download link from email
Links expire after 24 hours

Server Configuration Issues Advanced

PHP Requirements

Requirement Minimum Recommended Check
PHP Version 7.4 8.0+ Settings → Debug → System Info
PHP Memory Limit 128M 256M+ php_info() or hosting panel
Max Execution Time 30s 60s+ php_info() or hosting panel
Max Upload Size 2M 10M+ Media Library upload test

Required PHP Extensions

  • GD or ImageMagick - For image processing in PDFs
  • mbstring - For multi-byte string support
  • DOM - For HTML parsing (usually enabled)
  • curl or allow_url_fopen - For remote logo loading
💡 How to Check:
Create a file phpinfo.php in your site root with:
<?php phpinfo(); ?>
Visit yoursite.com/phpinfo.php to see all PHP settings
Delete file after checking!

Hosting-Specific Issues

Hosting Type Common Issue Solution
Shared Hosting Low memory limits
Execution timeouts
Contact support to increase limits
Consider VPS upgrade for high volume
Managed WordPress Restricted file system
Custom caching
Ensure uploads directory is writable
Disable caching for PDF generation URLs
WP Engine Object caching conflicts Exclude PDF URLs from caching
Contact WP Engine support if issues persist
Cloudflare PDF download blocked Add page rule to bypass cache for:
*admin-ajax.php?action=wc_pdf*

Getting Further Help Support

Before Contacting Support

1
Gather system information:
Settings → Debug → Copy "System Info" section
2
Enable debug mode and reproduce error:
Settings → Enable Debug Mode
Attempt the action that causes the problem
Copy error log
3
Test with defaults:
Temporarily switch to default template
Deactivate other plugins
Switch to default WordPress theme
Note if problem persists
4
Take screenshots:
Error messages
Plugin settings
Browser console (F12) showing errors

Support Ticket Template

**Subject:** [Brief description of issue] **Problem Description:** [Detailed description of what's not working] **Steps to Reproduce:** 1. [First step] 2. [Second step] 3. [Error occurs] **Expected Behavior:** [What should happen] **Actual Behavior:** [What actually happens] **System Information:** - WordPress Version: [X.X.X] - WooCommerce Version: [X.X.X] - Plugin Version: [X.X.X] - PHP Version: [X.X.X] - Theme: [Theme name] **Error Logs:** [Paste relevant error logs here] **Screenshot:** [Attach screenshot if applicable] **Troubleshooting Steps Already Tried:** - [ ] Disabled other plugins - [ ] Switched to default theme - [ ] Cleared cache - [ ] Checked file permissions - [ ] [Other steps]
✅ Response Time: Support typically responds within 24-48 hours on business days. Priority support available for premium license holders.

Quick Reference: Error Codes

Error Message Quick Fix
"DomPDF class not found" Re-upload plugin completely (vendor folder missing)
"Failed to write PDF file" Check upload directory permissions (chmod 755)
"Invoice file not found" Click "Regenerate Invoice" in order meta box
"Security check failed" Clear browser cache and refresh page
"No orders found" Adjust date range or order status filters
"Template not found" Reset template to "default" in settings
"Access denied" Check user has manage_woocommerce capability