=== Custom Meta Fields for FluentCart ===
Contributors: projectaaron
Tags: fluentcart, custom fields, gtin, ean, structured data
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add your own fields to FluentCart products and show them anywhere with a shortcode. Pro adds media, repeaters and checkout fields.

== Description ==

Custom Meta Fields for FluentCart adds the product fields FluentCart leaves out. Define a field once and it appears on every FluentCart product edit page, in its own card below the product details.

Values are stored as real WordPress post meta and registered with `register_post_meta()`, so they are typed, exposed in the REST API, copied when a product is duplicated, and readable by page builders' custom-field dynamic tags.

= Free features =

* **Unlimited product fields:** text, textarea, number, select, checkbox, URL, email, date and color.
* **Shortcodes:** `[cmf_field key="FIELD_ID"]` prints a field anywhere, with the shortcode shown and copyable next to each field.
* **Product structured data:** Product, BreadcrumbList and Organization JSON-LD built live from FluentCart prices, stock, images, store address, return policy and shipping rates.
* **GTIN, EAN, UPC, ISBN and MPN per variation:** FluentCart has a SKU per variation but no GTIN. Add one to every variation, plus a brand per product, with check-digit validation and duplicate detection. They go into Google structured data (as a ProductGroup with one variant per variation), and `[cmf_gtin]` shows the selected variation's code.
* **Fluent look:** the settings screen matches the Fluent suite, supports dark mode and loads inside the FluentHub portal.
* **REST API and WordPress Abilities (MCP):** let AI agents and integrations manage your fields.
* **Permissions:** follows FluentCart's own roles for who can define fields and edit values.

= Pro features =

[Custom Meta Fields for FluentCart Pro](https://upfluent.io/meta-fields/) adds:

* **Media fields:** images, video, audio or files from the media library, rendered responsively.
* **Repeater fields:** rows of sub-fields with drag-and-drop ordering, and `[cmf_repeater]` in list, grid or scrolling-row layouts.
* **Elementor widgets** for media and repeater fields.
* **Checkout fields:** add your own questions to the FluentCart checkout with placement, required and conditional logic. Answers are saved on the order and shown on the order screen, the thank-you page and in emails.
* **File uploads at checkout,** stored through FluentCart's own storage driver (local, S3 or R2).
* **Identifier import:** bring GTINs and MPNs over from WooCommerce (its own GTIN field and the common GTIN plugins), matched on SKU, or import a CSV. Every row is previewed before anything is saved.

== Installation ==

1. Install and activate FluentCart.
2. Upload the plugin zip under Plugins → Add New → Upload, and activate.
3. Go to FluentCart → More → Custom Fields (or Custom Fields in the FluentHub portal).
4. Add a field, then open any product to fill it in.

== Frequently Asked Questions ==

= Where do I get support? =
At [upfluent.io/support](https://upfluent.io/support/). Free and Pro users are both welcome.

= Where are product values stored? =
As WordPress post meta on the product, keyed by the field ID.

= Where are checkout answers stored? =
On the order, in FluentCart's order meta, with a snapshot of the field label so old orders never change.

= Can I add a GTIN or EAN to each variation? =
Yes, in the free version. Open a product: GTIN and MPN are columns right next to SKU in FluentCart's Inventory Management table, and save as you leave the field. The brand is set in the Custom Meta Fields card. A 10-digit ISBN is converted to its 13-digit GTIN automatically.

= I am moving from WooCommerce. Can I keep my GTINs? =
Yes, with Pro. If the WooCommerce data is still in the same database, Custom Fields → Identifiers → Import from WooCommerce matches every GTIN to its FluentCart variation by SKU. Otherwise export a CSV of SKU and GTIN and import that.

= Does it need Fluent Forms? =
No. Checkout fields (Pro) render directly into FluentCart's checkout form.

= Does this plugin send data anywhere? =
No. The free version makes no outside requests and collects no data. Pro contacts upfluent.io only to activate your licence and check for updates.

= How do I get Pro? =
Buy Pro or start the 14-day free trial at [upfluent.io](https://upfluent.io/fluentcart-custom-meta-fields/). Download the Pro plugin from your account, upload it under Plugins → Add New (it replaces the free version and keeps all your fields and values), then paste your licence key on the License tab.

== Changelog ==

= 3.0.1 =
* Clearer Pro panels: real use cases for each Pro feature, a checkout preview, and the 14-day free trial up front.

= 3.0.0 =
* Freemius removed from both versions. The free version no longer shows an opt-in screen or contacts any outside service.
* Pro licences are now sold and activated through upfluent.io (FluentCart). Pro updates arrive through the normal WordPress updates screen while the licence is active.
* New License tab: activate, check and deactivate your licence on this site.
* Pro is now its own plugin, "Custom Meta Fields for FluentCart Pro". Installing it replaces the free version and keeps all fields and values.

= 2.6.13 =
* The Freemius SDK is now bundled with Composer (vendor/freemius/wordpress-sdk).

= 2.6.12 =
* Slug and text domain are now custom-meta-fields-for-fluentcart, matching the WordPress.org address.

= 2.6.11 =
* Support link on the Plugins screen and a support FAQ, both pointing to upfluent.io/support.
* WordPress.org Plugin Check clean-up.
* Media and repeater display code now ships only in Pro, so the free version contains no locked features.
* Free: picking Media or Repeater as a field type shows what Pro adds, with an upgrade link.
* Fixed the Cancel button showing on the Add New Field form when not editing.

= 2.6.10 =
* The "By upfluent.io" link on the Plugins screen now opens the Custom Meta Fields page.

= 2.6.9 =
* The plugin name now reads "… - By Upfluent.io" on both the Plugins and Updates screens, for Free and Pro.

= 2.6.8 =
* The plugin now shows as "Custom Meta Fields for FluentCart Pro - By Upfluent.io" (Pro) and "… - By Upfluent.io" on the Plugins screen (Free).

= 2.6.7 =
* New: a welcome panel after activation with the three steps to your first field, a button that jumps straight to the Add Field form and a link to the getting-started guide. Dismiss it any time.

= 2.6.6 =
* New: after each FluentCart update, the plugin checks whether FluentCart now includes its own GTIN fields, product structured data or custom fields. If it does, admins see a notice that their data is safe and a migration update will follow. Nothing is changed automatically.

= 2.6.5 =
* Fixed: FluentCart's sidebar menu kept its order. Adding Custom Fields (and the Freemius account links) no longer sorts FluentCart's menu alphabetically or turns the top "FluentCart" link into a link to Custom Fields.

= 2.6.4 =
* Fixed: checkout file uploads on block themes (such as Twenty Twenty-Five) failed with "session expired".
* Fixed: file uploads from Buy Now / instant checkout links.
* Fixed: conditional checkout fields now work when the rule uses the field ID without the cmf_ prefix.
* Fixed: all shortcodes accept both post_id and product_id.
* The [cmf_gtin] shortcode hides itself when the selected variation has no code, so the label never shows alone.
* Date answers show in your site's date format on the receipt, order screen and emails.
* Book products with a 978/979 GTIN now include the ISBN in structured data.
* Tidier receipt styling for checkout answers.

= 2.6.3 =
* The GTIN placeholder reads EAN/UPC/ISBN so it fits the column.

= 2.6.2 =
* GTIN and MPN are now their own columns, titled in the header, right after SKU in FluentCart's Inventory Management table, so SKU, GTIN and MPN sit on one line. The other columns narrow to make room, so nothing is cut off.

= 2.6.1 =
* GTIN and MPN now sit directly below each variation's SKU in FluentCart's Inventory Management section and save as soon as you leave the field. The Custom Meta Fields card keeps the brand, and shows the full table only when no SKU field is on screen.

= 2.6.0 =
* New: GTIN (EAN, UPC, ISBN) and MPN for every FluentCart variation, and a brand per product, in the product's Custom Meta Fields card. Check digits are validated as you type, duplicates across products are refused, and ISBN-10 is converted to GTIN-13.
* New: structured data carries the codes. A product with several coded variations is output as a ProductGroup with one Product and Offer per variation, the format Google's merchant listings expect.
* New: [cmf_gtin] shortcode shows the selected variation's GTIN (or type="mpn", type="brand") and follows the shopper's variation choice.
* New: get-product-identifiers and set-product-identifiers abilities for AI agents, and a REST endpoint.
* Pro: import identifiers from WooCommerce (matched on SKU) or from a CSV, with a preview of every row first.

= 2.5.6 =
* "Start 14-day free trial" buttons, and Freemius' own trial links now open a trial checkout instead of a paid one.
* Pro: checkout fields placed before billing, after the checkout button or with the order notes now also show on block-based checkout pages.
* Licence activation no longer opts the site admin into marketing email.
* Uninstall cleanup runs again, and is skipped while the other edition (free or Pro) is still installed.
* Field IDs can no longer reuse a meta key WordPress, FluentCart or another plugin already writes, and deleting a field only touches FluentCart products.
* Pro: file uploads are accepted only for enabled, licensed fields; simultaneous uploads no longer overwrite each other's record.
* Pro: uploaded files are deleted when their order is deleted, and are included in WordPress' personal data export and erase tools.
* Pro: if FluentCart starts a new order after a failed payment, the uploaded file moves to the new order instead of being dropped.
* Pro: image preview links stop working if the file behind them changes, and remote files are type-checked before redirecting.
* Shortcodes and widgets no longer read draft, private or password-protected products named by ID; structured data is skipped on password-protected products.
* Licence download and deactivate links are shown to site administrators only.
* Text domain changed to fct-custom-meta-fields to match the plugin slug.

= 2.5.5 =
* Pro: the order receipt and the admin order screen show a preview of images uploaded through checkout fields (JPG, PNG, GIF, WebP). Clicking it opens the full image.

= 2.5.4 =
* 14-day Pro trial (payment method required).

= 2.5.3 =
* Freemius WordPress.org gatekeeper key added to the SDK settings (removed automatically from the free version).

= 2.5.2 =
* After upgrading from the free version, the free copy is now deactivated automatically. Pro is standalone and includes every free feature.
* If the free and Pro versions are ever active together, the free copy steps aside so Pro runs, and deactivates itself.

= 2.5.1 =
* "Upgrade to Pro" now opens the Freemius checkout in a new tab instead of the in-dashboard pricing page, which showed a blank screen.

= 2.5.0 =
* Upgrade from the free version inside the plugin: activate a Pro licence on the License tab and the Pro version is downloaded, installed and activated automatically. Fields and values are kept.
* Pro features now require both an active licence and the Pro version installed.
* Contributor set to upfluent.

= 2.4.1 =
* Admin script split in two: the Media, Repeater and Checkout Fields screens now live in a separate Pro-only file that is not included in the free version.

= 2.4.0 =
* Free version for WordPress.org. Media fields, Repeater fields, the Elementor widgets and checkout fields move to Pro, and their code is removed from the free build.
* Plugin renamed to Custom Meta Fields for FluentCart.

= 2.3.8 =
* Test release for Freemius automatic updates. No functional changes.

= 2.3.7 =
* Author set to upfluent.io.

= 2.3.6 =
* License tab accepts Freemius keys containing symbols.

= 2.3.5 =
* Freemius init uses a literal SDK parameter array so deployments validate.

= 2.3.4 =
* Uninstall cleanup moved to Freemius' after_uninstall hook; uninstall.php removed.

= 2.3.3 =
* License tab with in-page activation (Freemius Account page is hidden inside the FluentHub portal).

= 2.3.2 =
* Tuned dark-mode palette for the admin screen.

= 2.3.1 =
* Freemius product credentials; free version marked wordpress.org compliant.

= 2.3.0 =
* Freemius SDK integration with runtime Pro gating (Repeater, Checkout Fields, uploads).

= 2.2.0 =
* Loads inside the FluentHub portal as a Custom Fields app; admin rebuilt on Fluent design tokens with dark mode.

= 2.1.1 =
* Fixed "upload expired" error on checkout submit.

= 2.1.0 =
* File upload checkout fields via FluentCart storage drivers; checkout fields on FluentCart's Checkout Fields settings screen.

= 2.0.0 =
* Checkout fields with placement, required and conditional logic; order screen, thank-you page and email smartcodes.

= 1.9.0 =
* Shortcode shown and copyable per field.

= 1.7.0 =
* Product JSON-LD with return policy and shipping details.

= 1.3.0 =
* Media and Repeater field types; values moved to WordPress post meta; Elementor widgets.

= 1.0.0 =
* Initial release.
