Woo ATF Form 3 Generator
This WordPress plugin is designed to help automate filling out Form 3 with customer and dealer info in a WooCommerce order.
by Metrotechs 👾 · github.com/metrotechs/ffl-form-3-automation · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/metrotechs/ffl-form-3-automation/archive/refs/heads/main.zipReadme
Woo ATF Form 3 Generator
Version: 1.3.0 Requires WordPress: 5.2 or higher Requires WooCommerce: 3.0 or higher (Tested with latest versions) Requires PHP: 7.2 or higher License: GPL v2 or later
Description
The Woo ATF Form 3 Generator is a WordPress plugin designed to streamline the process of creating ATF Form 3 (5320.3) documents for firearm transfers between FFL holders. It automatically populates the form using data from completed WooCommerce orders and configurable plugin settings.
When an order containing items belonging to the 'Supressors' product category (slug: supressors, by default) is set to "Completed" status, this plugin generates a filled ATF Form 3 PDF using your uploaded template and company details.
Features
- Automatic PDF Generation: Creates ATF Form 3 PDF when a relevant WooCommerce order is marked as "Completed".
- Category Trigger: Identifies required items based on their assignment to a specific product category (default slug:
supressors). - Settings Page: Configure plugin options under Settings -> ATF Form 3 Gen.
- Upload your specific ATF Form 3 PDF template via the WordPress Media Library.
- Enter your company's (Transferor) details (Name, Address, Phone, Email, FFL, EIN/Class).
- Select which WooCommerce emails should automatically have the generated PDF attached.
- Data Integration: Pulls Transferee (receiving FFL dealer) information from order meta data.
- Item Listing: Populates the form with relevant item details (name, quantity, optional serial number) from the order, filtered by the specified category.
- PDF Storage: Saves the generated PDF to a dedicated folder within the WordPress uploads directory (
wp-content/uploads/atf-form3-generated/). - Order Notes: Adds notes to the WooCommerce order indicating success or failure of PDF generation, including a link to the PDF upon success.
- Email Attachments: Optionally attaches the generated PDF to specified WooCommerce admin and customer emails.
Installation
- Download/Clone: Obtain the plugin files (e.g., download ZIP from repository or clone via Git).
- Upload: Upload the
wc-atf-form3-generatordirectory to the/wp-content/plugins/directory of your WordPress installation.- Alternatively, upload the ZIP file via Plugins -> Add New -> Upload Plugin.
- Install Dependencies:
- Navigate to the plugin's directory via command line/terminal:
cd /path/to/your/wordpress/wp-content/plugins/wc-atf-form3-generator/ - Run Composer to install the required PDF libraries (FPDF & FPDI):
composer install - Note: You need Composer installed on your server or local development environment.
- Navigate to the plugin's directory via command line/terminal:
- Activate: Activate the plugin through the 'Plugins' menu in WordPress.
Configuration & Usage
- Navigate to Settings: Go to Settings -> ATF Form 3 Gen in your WordPress admin area.
- Upload Template: Use the "Upload Template PDF" button to select and upload your official ATF Form 3 (5320.3) PDF file. This will be used as the base for filling data.
- Enter Transferor Info: Fill in all the fields under "Transferor Information (Your Company)". This data will be used to populate the transferor sections of the form. Name and FFL Number are required for generation.
- Configure Email Attachments: Check the boxes for the WooCommerce emails you wish to have the generated PDF automatically attached to.
- Save Settings: Click "Save Settings".
- Product Setup: Ensure products that require an ATF Form 3 (e.g., suppressors) are assigned to the product category with the slug
supressors.- Important: If you use a different category slug (e.g.,
nfa-items), you must update theWC_ATF_FFL_CATEGORY_SLUGconstant defined near the top of the mainwc-atf-form3-generator.phpfile to match your category's slug exactly.
- Important: If you use a different category slug (e.g.,
- FFL Dealer Meta: Ensure that when an order is placed, the selected receiving FFL dealer's information is saved to the order meta data with the key
selected_ffl_dealer. This meta value should be an array containing keys likename,address,license_number,ein,class. (The mechanism for selecting and saving this FFL data is outside the scope of this plugin and needs to be handled by your theme or another plugin, like an FFL dealer locator/selector). - Serial Numbers (Optional): If you want serial numbers included on the form, ensure they are saved as order item meta data with the key
_serial_number. - Adjust Coordinates (CRITICAL): The placement of text on the PDF depends on X/Y coordinates. You must edit the
$coordsarray within thewc_atf_generate_form_3_pdffunction in the fileincludes/pdf-generator.phpto match the layout of your specific template PDF. Use a PDF editor or measurement tool to find the correct coordinates for each field. Incorrect coordinates will result in misplaced text.
Operation
- When a WooCommerce order containing at least one item belonging to the category defined by
WC_ATF_FFL_CATEGORY_SLUG(default:supressors) is marked as "Completed", the plugin checks for the necessary settings (template, transferor info) and FFL dealer data in the order meta. - If prerequisites are met, it generates the PDF, saves it to
/wp-content/uploads/atf-form3-generated/, adds an order note, saves the file path/URL to order meta (_wc_atf_form3_pdf_path,_wc_atf_form3_pdf_url), and attaches it to the configured emails.
Libraries Used
This plugin relies on the following open-source libraries managed via Composer:
- FPDF: For basic PDF generation tasks.
- FPDI: For importing pages from existing PDF documents (the template).
Support
This plugin is provided as-is. For issues or potential enhancements, please refer to the plugin's repository (if applicable) or contact the author. Ensure you have correctly configured settings, set the correct category slug (if not using the default), and adjusted PDF coordinates before seeking support.