=== BBM Vehicle Fitment for WooCommerce ===
Contributors: bigbootmedia
Tags: woocommerce, vehicle fitment, make model year, automotive, compatibility
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a Make, Model, Year and Engine vehicle fitment selector to multiple selected WooCommerce products using your own CSV compatibility data.

== Description ==

BBM Vehicle Fitment for WooCommerce adds a dependent Make, Model, Year and Engine selector to selected WooCommerce product pages.

Store owners can upload fitment data by CSV, choose multiple WooCommerce products or variation SKUs that require the selector, customise the compatibility message and keep an optional internal fitment code with each order item. All selected products use the same imported fitment dataset.

Key features:

* Make, Model, Year and Engine dependent selectors.
* Searchable multi-select for WooCommerce products and variation SKUs in the plugin settings.
* CSV-based fitment management.
* Optional internal fitment code stored privately with order items.
* Selected vehicle details shown in the cart, checkout and order.
* Configurable compatibility message, contact URL and accent colour.
* Server-side validation before a product can be added to the cart.
* Responsive two-column desktop layout and single-column mobile layout.

The plugin does not send fitment data to an external service. Fitment records are stored in your WordPress database.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin ZIP from Plugins > Add New > Upload Plugin, or install it from the WordPress plugin directory when available.
3. Activate BBM Vehicle Fitment for WooCommerce.
4. Go to WooCommerce > Vehicle Fitment.
5. Search by name or SKU and select all products that should display the vehicle selector.
6. Upload your fitment CSV.
7. Test multiple vehicle combinations before using the selector on a live store.

== CSV Format ==

Required columns:

`Make,Model,Year,Engine`

Optional columns:

`FitmentCode,Notes`

Example:

`Make,Model,Year,Engine,FitmentCode,Notes`
`Example Make,Example Model,2025,2.0L,EX-001,Example note`

For easier migration from an existing system, `Plug` and `Code` are also accepted as aliases for `FitmentCode`.

The CSV is validated before the current fitment dataset is replaced. The maximum upload size is 5 MB and the maximum number of data rows is 50,000.

== Frequently Asked Questions ==

= Does this work with every WooCommerce product? =

You can select multiple products by name or SKU. For a selected variation SKU, the selector is shown when that specific variation is selected on its parent product page. All selected products share the same imported fitment CSV, so make sure that data is appropriate for every selected product.

= Is the internal fitment code visible to customers? =

No. The vehicle selection is shown to the customer, while the optional internal fitment code is stored as hidden order-item metadata and displayed to store administrators.

= Do I need a fitment code? =

No. Make, Model, Year and Engine are required. FitmentCode and Notes are optional.

= Does the plugin use an external API? =

No. The fitment dataset is stored locally in your WordPress database and the selector filters the loaded fitment data in the browser.

= What happens if a vehicle is not in my CSV? =

That combination cannot be selected as a valid fitment. You can also configure a contact URL so customers can ask you to confirm compatibility.

== Screenshots ==

1. Vehicle selector on a WooCommerce product page.
2. Vehicle Fitment settings under WooCommerce.
3. CSV import and fitment row count.
4. Vehicle details stored with a WooCommerce order item.

== Changelog ==

= 1.1.1 =
* Validate and sanitize multiple product and variation IDs when saving settings.

= 1.1.0 =
* Select multiple WooCommerce products or variation SKUs by name or SKU.
* Show the vehicle selector on all selected product pages.
* For individually selected variation SKUs, show the selector only when that variation is chosen.
* Migrate the previous single-product selection automatically during upgrades.
* Correct the WooCommerce admin asset hook for the product search control.

= 1.0.2 =
* Sanitize CSV upload metadata before use to satisfy WordPress coding standards.

= 1.0.1 =
* Align translation text domain with the WordPress.org plugin slug.
* Improve CSV upload parsing, request validation and database query handling.
* Cache fitment lookups and refresh cached data after imports.

= 1.0.0 =
* Initial Big Boot Media public release.
* Generic Make, Model, Year and Engine vehicle selector.
* WooCommerce product search setting.
* CSV validation and replacement workflow.
* Optional internal fitment code.
* Cart, checkout and order integration.
* Configurable contact URL, compatibility message and accent colour.

== Upgrade Notice ==

= 1.1.1 =
Maintenance update improving validation of selected product and variation IDs.

= 1.1.0 =
Adds multiple product and variation SKU targeting. Existing single-product settings are preserved.

= 1.0.2 =
Maintenance release improving CSV upload handling.

= 1.0.1 =
Maintenance release improving CSV processing and WordPress.org compatibility.

= 1.0.0 =
Initial release.
