=== Dprime Woo Product Warranty ===
Contributors: dprime
Tags: woocommerce, warranty, guarantee, product tab, badge
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.2.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Set a warranty term for each WooCommerce product and show it on the product page, in a warranty tab, in the shop, and anywhere with a shortcode.

== Description ==

Dprime Woo Product Warranty adds a warranty field to every WooCommerce product, such as 6 Months Warranty, 1 Year Warranty, or Lifetime Warranty. You decide where the warranty appears: as a text line on the single product page, as a warranty tab with a full description, on the shop and category pages, and anywhere else through a shortcode.

Warranty terms are fully editable. Each term has a label, a duration, a color, and a description. The duration feeds the schema.org structured data and the description feeds the warranty tab.

The plugin is free and connects with the rest of the Dprime plugin suite. When Dprime Woo Filters, Dprime Woo Product Importer, Dprime AI Smart Woo Chatbot, or Dprime Woo Wishlist are active, the warranty flows into them automatically, and each connection can be turned off on the Integrations tab.

This is an alpha release. Data structures may still change before the stable release.

Features:

* A Warranty field on the product General tab. Variations inherit the parent warranty.
* An editable list of warranty terms, each with a label, a duration, a color, and a description.
* A warranty text line on the single product page, with a choice of position and an optional shield icon.
* A warranty tab on the product page with the term and its description.
* A warranty text line on shop and category pages.
* A dprime_warranty shortcode with text, badge, and box styles.
* Integrations with the Dprime plugin suite, each with its own toggle.
* A read only dprime_warranty field on product REST responses.
* Schema.org WarrantyPromise with the coverage duration in the offer structured data.
* A CSS load toggle, a Custom CSS box, and a full class reference.
* A developer API: dpwpw_get_warranty, dpwpw_set_warranty, dpwpw_badge_html, dpwpw_text_html, dpwpw_box_html.

== Installation ==

1. Upload the plugin folder to the /wp-content/plugins/ directory, or install the zip through Plugins, Add New, Upload Plugin.
2. Activate the plugin through the Plugins menu in WordPress.
3. Open Woo Product Warranty from the admin menu to set your warranty terms and display options.
4. Edit a product, open the General tab in the Product data panel, and choose a warranty.

== Frequently Asked Questions ==

= Does a product have to have a warranty? =
No. Products with no warranty set show nothing, so you can leave the display options on without affecting other products.

= Can I change the warranty labels and durations? =
Yes. Open the Warranties tab to add, rename, or remove terms and set the duration, color, and description for each one.

= Where does the warranty tab come from? =
When the Warranty Tab option is on and a product has a warranty term, a tab is added to the product page showing the term and its description. Products without a warranty show no tab.

= How do I place the warranty somewhere specific? =
Use the dprime_warranty shortcode. It reads the current product automatically, or takes an id attribute, and renders the text line, an inline badge, or the full warranty box. The full attribute list is on the Help tab.

= What do the integrations do? =
When another Dprime plugin is active, the warranty connects to it automatically: the term shows in the Woo Filters grid, the importer can set the warranty from the source page, the chatbot can answer warranty questions, and the wishlist shows the term next to saved items. Each connection has a toggle on the Integrations tab.

= Can customers see when their warranty ends? =
Yes. Once a product with a warranty is purchased, the order shows a coverage line for that item stating when the warranty started and when it ends, on the My Account order view and in order emails.

= Can I see warranty coverage as a store owner? =
Yes. The order edit screen in wp-admin has a Warranty column in the order items table showing the same coverage dates.

= Can I set the warranty on many products at once? =
Yes. Select multiple products on the Products screen, choose Bulk Edit from the Bulk Actions menu, and a Warranty field appears alongside the built in WooCommerce fields.

= Does this plugin require a Dprime subscription? =
No. Dprime Woo Product Warranty is free.

== Screenshots ==

1. The display settings for the single product page, the warranty tab, and the shop.
2. The editable warranty terms table with labels, durations, colors, and descriptions.
3. The Integrations tab with the Dprime plugin connections.
4. The warranty tab shown on a product page.

== Changelog ==

= 1.2.1 =
* Verified Filters, Wishlist, and Product Importer integrations.
* Added product and order-item warranty metadata cleanup on uninstall.
* Promoted the verified release to the stable channel.

= 1.1.0 =
* Order coverage dates. When a product with a warranty is purchased, the term is recorded on the order at the time of purchase. The My Account order view, order emails, and the order edit screen in wp-admin now show when that item's warranty starts and ends, calculated from the order date or the completed date, whichever you choose on the Display tab.
* Bulk editing. Select multiple products on the Products screen, choose Bulk Edit, and set or remove the warranty for all of them at once.
* Lifetime terms show as lifetime coverage with no end date. No coverage terms show no coverage line, on orders and everywhere else.

= 1.0.0 =
* First release, alpha channel.
* Added a Warranty field to the WooCommerce product General tab, saved as product meta. Variations inherit the parent warranty.
* Added an editable warranty terms list, each with a label, a duration, a color, and a description. A default set is created on activation.
* Added display options for the single product page text line, the warranty tab, and the shop loop text, plus a text prefix, a shield icon toggle, and a text color toggle.
* Added a dprime_warranty shortcode with text, badge, and box styles.
* Added an Integrations tab connecting the plugin to Dprime Woo Filters, Woo Product Importer, AI Smart Woo Chatbot, and Woo Wishlist, plus a REST API field and schema.org structured data, each with its own toggle.
* Added a developer API: dpwpw_get_warranty, dpwpw_set_warranty, dpwpw_badge_html, dpwpw_text_html, dpwpw_box_html, dpwpw_integration_enabled.
* Added a CSS tab with a stylesheet load toggle, a Custom CSS box, and the full class reference.
* Added uninstall cleanup that removes the plugin options and the product warranty meta.

== Upgrade Notice ==

= 1.1.0 =
Adds order coverage dates and bulk editing for the warranty field.

= 1.0.0 =
First release, alpha channel.
