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

Set a condition for each WooCommerce product and show it on the product page, the product image, the shop, and anywhere with a shortcode.

== Description ==

Dprime Woo Product Condition adds a simple condition field to every WooCommerce product, such as New, Open Box, Refurbished, Used, or For Parts. You decide where the condition appears: as a text line on the single product page, as a badge on the product image, on the shop and category pages, and anywhere else through a shortcode.

Conditions are fully editable. Set your own labels and a color for each one, and the color is used for both the text and the image badge.

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 condition flows into them automatically, and each connection can be turned off on the Integrations tab.

Features:

* A Condition field on the product General tab.
* An editable list of conditions, each with a label, a color, and a Google value.
* Show the condition as text on the single product page, with a choice of position.
* Show the condition as a badge on the product image.
* Show the condition text and badge on shop and category pages.
* A dprime_condition shortcode with text and badge styles.
* Integrations with the Dprime plugin suite, each with its own toggle.
* A read only dprime_condition field on product REST responses.
* Schema.org itemCondition in the product structured data.
* Google Merchant Center compatibility through Google for WooCommerce or any feed plugin.
* A CSS load toggle, a Custom CSS box, and a full class reference.
* A developer API: dpwpc_get_condition, dpwpc_set_condition, dpwpc_badge_html, dpwpc_text_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 Condition from the admin menu to set your conditions and display options.
4. Edit a product, open the General tab in the Product data panel, and choose a condition.

== Frequently Asked Questions ==

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

= Can I change the condition labels and colors? =
Yes. Open the Conditions tab to add, rename, recolor, or remove conditions.

= Where does the badge appear? =
The badge sits in a corner of the product image on the single product page and, if enabled, on the shop and category images. You can choose the left or right corner. The shortcode can also render an inline badge anywhere.

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

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

= Can I set the condition on many products at once? =
Yes. Select multiple products on the Products screen, choose Bulk Edit from the Bulk Actions menu, and a Condition field appears alongside the built in WooCommerce fields. This also keeps the Google Merchant value in sync when that setting is on.

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

== Screenshots ==

1. The display settings for the single product page and the shop.
2. The editable conditions table with labels, colors, and Google values.
3. The Integrations tab with the Dprime plugin connections.
4. A condition badge shown on a product image.

== Changelog ==

= 1.4.1 =
* Verified Filters, Wishlist, and Product Importer integrations.
* Added complete product-condition metadata cleanup on uninstall.
* Promoted the verified release to the stable channel.

= 1.3.0 =
* Bulk editing. Select multiple products on the Products screen, choose Bulk Edit, and set or remove the condition for all of them at once. Setting a condition in bulk keeps the Google Merchant value in sync when that setting is on, the same as editing one product at a time.

= 1.2.0 =
* Beta release channel.
* Redesigned the admin to the Dprime design system with a card layout, toggle rows, and an edge to edge conditions table.
* Added a dprime_condition shortcode with text and badge styles and a shortcode bar in the admin.
* 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: dpwpc_get_condition, dpwpc_set_condition, dpwpc_badge_html, dpwpc_text_html, dpwpc_integration_enabled.
* Moved the stylesheet toggle and the Custom CSS box to a dedicated CSS tab with the full class reference. Existing values migrate automatically.
* Declared WooCommerce HPOS compatibility and added a Settings link on the Plugins screen.

= 1.1.0 =
* Added custom styling options. You can turn off the plugin frontend stylesheet and style everything yourself, and there is a Custom CSS box that loads on the frontend either way.
* Added a CSS Classes tab that lists every class the plugin outputs, with a markup example, so styling your own version is straightforward.
* Added Google Merchant compatibility. Each condition maps to a Google value of new, refurbished, or used, and the condition is sent to Google Merchant Center on sync. It works with Google for WooCommerce automatically, and other feed plugins can map the Product Condition (Dprime) field.

= 1.0.0 =
* First release. Adds a per product condition field, an editable conditions list with colors, and display options for the single product page, the product image badge, and the shop pages.

== Upgrade Notice ==

= 1.3.0 =
Adds bulk editing for the condition field, including Google Merchant sync.

= 1.2.0 =
Redesigned admin, a shortcode, Dprime plugin integrations, a REST field, structured data, and a developer API. Beta release.

= 1.1.0 =
Adds custom styling controls, a CSS classes reference, and Google Merchant Center compatibility for the product condition.

= 1.0.0 =
First release.
