﻿=== FFL API Integration for WooCommerce ===
Contributors: optimum7
Tags: ffl, woocommerce, firearms, gun dealers
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.6.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
FFL dealer selection for WooCommerce checkout.

== Description ==

FFL API Integration for WooCommerce is designed for WooCommerce-powered online stores that sell firearm-related products requiring shipment to licensed FFL dealers.

The plugin integrates with the FFL API service to allow customers to select a licensed dealer during checkout. This helps store owners clearly separate FFL and non-FFL products and guide customers through the appropriate checkout flow.

This plugin requires an active WooCommerce installation and valid API credentials from FFL API.


== Shop Owners ==

Online shop owners selling regulated firearm products often need a clear and structured checkout experience that supports FFL dealer selection.

This plugin provides tools to:
- Identify firearm products
- Display FFL dealer selection during checkout
- Manage dealer-related shipment details within WooCommerce


== Customers Purchasing FFL Products ==

Customers purchasing firearm products can search for nearby licensed FFL dealers by ZIP code during checkout and select a dealer before completing their order.

The selected dealer’s information is displayed clearly to help avoid confusion during fulfillment.


== Screenshots ==

1. Plugin settings page
2. Assigning products as firearms
3. Bulk product management
4. FFL dealer search by ZIP code


== Features ==

= Checkout Integration =
Displays an FFL dealer search field on the WooCommerce checkout page when firearm products are present in the cart.

= Firearm Product Identification =
Allows store administrators to mark products as firearm or non-firearm.

= Bulk Product Updates =
Provides bulk actions in the admin panel to update firearm status for multiple products.

= FFL Dealer Map =
Displays nearby licensed FFL dealers based on customer ZIP code using Google Maps.

= Dealer Search by ZIP Code =
Customers can search for FFL dealers within a defined radius and select one during checkout.

= Automatic Updates =
The plugin supports WordPress automatic update notifications.

= Color Customization =
Admin users can adjust basic color settings for the FFL dealer list display.

= Flexible Placement =
The FFL dealer selection area can be positioned in different locations on the checkout page:
* Order Review
* Above Billing Form
* Below Billing Form
* Above Shipping Form
* Below Shipping Form


== Demo ==
You can view a demo of the plugin functionality here:
[FFL API Demo](https://wpdemo.fflapi.com/)


== Frequently Asked Questions ==

= Can I use the same API key for multiple websites? =
No. Each website requires a separate API key.

= Do unused API requests roll over to the next month? =
No. API request limits reset with each billing cycle.

= Can customers search dealers by address or ZIP code? =
Yes. Customers can search for licensed FFL dealers using ZIP code information.

= How is dealer license information maintained? =
FFL dealer data is updated through the FFL API service.


== Installation ==

= Minimum Requirements =
* WordPress 5.0 or higher
* PHP 7.4 or higher
* MySQL 5.x
* WooCommerce plugin

= API Requirements =
To use this plugin, you need:
1. An FFL API key from https://app.fflapi.com/register
2. A Google Maps API key from https://developers.google.com/maps/documentation/maps-static/get-api-key

= Installation Steps =
1. Upload the plugin ZIP file via Plugins > Add New > Upload Plugin
2. Activate the plugin
3. Navigate to the "FFL API" menu in the WordPress admin
4. Enter your API keys and configuration settings
5. Save changes


== Assigning a Product as Firearm ==
1. Go to Products > All Products
2. Edit a product
3. Locate the firearm option in Product Data
4. Enable the firearm checkbox
5. Update the product


== How FFL Dealer Search Works ==
1. Add a firearm product to the cart
2. Proceed to checkout
3. Enter ZIP code in the FFL dealer search field
4. Select a dealer from the map or list
5. Complete checkout


== External Services ==

This plugin connects to the third-party FFL API service (https://fflapi.com) to retrieve licensed FFL dealer data and loads the dealer selection widget script from https://app.fflapi.com/sdk/woo-widget-v2.js during WooCommerce checkout. The customer's ZIP code and selected dealer information are sent to the FFL API service to display nearby dealers. Service terms and privacy: https://fflapi.com/

The dealer map is powered by the Google Maps Platform (https://developers.google.com/maps) using the API key you configure. Map/location queries are sent to Google. Terms: https://cloud.google.com/maps-platform/terms/ - Privacy: https://policies.google.com/privacy

== Changelog ==

= 1.6.5 =
* Declared license is now GPLv2 or later in both the readme and the plugin headers, matching the bundled LICENSE.txt
* Removed an unused bundled JavaScript file that had no human-readable source
* The checkout hook stored in the settings is validated against the list of hooks offered in the settings screen
* Escaped admin notices, image URLs and select options on output
* Fixed the Plugin URI and Author URI headers

= 1.6.4 =
* Renamed plugin display name in the plugin headers to match the directory listing
* Hardened checkout map initialization: values are JSON-encoded and printed via wp_print_inline_script_tag()
* Added ABSPATH guards to all plugin files
* Documented external services (FFL API, Google Maps Platform) in the readme
* Tested up to WordPress 7.0

= 1.6.3 =
* Documentation and packaging fixes

= 1.6.2 =
* Plugin name and documentation updates to comply with WordPress.org guidelines
* Internationalization improvements
* Settings sanitization enhancements

= 1.6.1 =
* Compatibility update for WooCommerce HPOS

= 1.6.0 =
* Admin panel input hint improvements

= 1.5.9 =
* Added option to control FFL info pop-up visibility

= 1.5.8 =
* Fixed FFL dealer map display issue

= 1.5.7 =
* Fixed special character handling in Firearm Warning Message

= 1.5.6 =
* Minor bug fixes and stability improvements

= 1.5.3 =
* Added form clear notice

= 1.5.2 =
* User interface fixes and minor improvements

= 1.5.1 =
* Fixed shipping address issue for WooCommerce 3.9 and later

= 1.5.0 =
* Initial public release