=== StoreCanvas Lite ===
Contributors: alextechgamer
Tags: woocommerce, product options, extra product options, product addons, conditional logic
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WC requires at least: 7.0

Free WooCommerce product options: 15 field types, conditional logic, per-choice/lookup/percent/quantity/per-character pricing, and option stock.

== Description ==

StoreCanvas Lite adds a full product options engine to WooCommerce — free forever, no license key, no account, no phone-home.

* 15 field types: dropdown, radio, checkbox, multi-select, short text, long text, email, phone, phone (tel), number, date, color, image choice, file upload, and section heading
* Flexible pricing per field: flat fee, percent of the product price, per quantity, per character (text fields), and per-choice lookup-table pricing — flat and per-choice amounts may be negative for discounts
* Live price preview on the product page that mirrors exactly what the server charges (classic and block themes)
* Multi-rule conditional logic (AND/OR with is, is not, contains, greater/less than, empty, in-list operators) plus simple show-if rules
* Per-choice option stock: give any choice a stock quantity, sold-out choices are disabled, stock decrements on order and restores on cancel/failure
* Reusable global option groups assigned to products or whole categories, with product-local overrides
* Field visibility by user role and by product variation
* Validation on add to cart: required fields, character limits, number ranges, email/color/date formats, and option stock
* Chosen options are shown in cart, checkout, order emails, and the admin order screen
* Compatible with WooCommerce HPOS and block checkout
* Help & demo page: one-click demo product with every pricing type, and a support ticket form

A paid **StoreCanvas** plugin (live design canvas with mockup placement, print-ready exports, and a production workflow) is sold separately at https://tillpress.com/storecanvas/. It is a different plugin. This Lite plugin is complete and is never locked.

== External services ==

StoreCanvas Lite has no license check, no telemetry, no account, and makes no outbound requests during normal use. The one exception is a support ticket you choose to send.

**Support tickets (only when you send one):** the Help & demo page has a support form. When an administrator fills it in, ticks the consent box, and presses **Send ticket**, the plugin sends the name, reply-to email, topic, subject, message, this site's address, and (if ticked) a system report of WordPress/WooCommerce/PHP versions, theme, and active plugin names to the Tillpress support desk at `https://tillpress.com/wp-json/tp/v1/support`. Nothing is sent automatically, in the background, or on a schedule, and no passwords, keys, or customer/order data are included. Service provider: Tillpress (Alex Software Holdings LLC). Privacy policy: https://tillpress.com/privacy/ — Terms: https://tillpress.com/terms/ . "Email instead" opens the same ticket in your own email app and sends nothing from the site.

== Installation ==

1. Upload the `storecanvas-lite` folder to `/wp-content/plugins/`
2. Activate through the Plugins menu (WooCommerce must be active)
3. Edit any product and open the **StoreCanvas Lite** tab to add option fields
4. Optionally create reusable groups under **Products → Option groups** and assign them to products or categories

== Frequently Asked Questions ==

= Is there a license key or trial? =
No. Every feature listed above works without a key, trial, or phone-home to the author.

= How does pricing work? =
Each field can add a flat fee, a percent of the product (or selected variation) price, an amount multiplied by the number the customer enters, an amount per character of entered text, or a per-choice price from a lookup table. Negative amounts act as discounts; the unit price never drops below zero.

= What is option stock? =
Any choice on a dropdown, radio, multi-select, or image-choice field can carry a stock quantity. Sold-out choices are disabled on the product page, add-to-cart validates remaining stock, and stock decrements when an order is placed and restores if the order is cancelled or fails.

= Can I reuse the same fields on many products? =
Yes. Create an option group under Products → Option groups, then assign it to product IDs and/or product categories — or pick groups per product on the product's StoreCanvas Lite tab. Product-local fields with the same id override group fields.

= Does conditional logic support multiple rules? =
Yes. Fields can use multi-rule conditions with AND/OR logic and operators: is, is not, contains, does not contain, greater/less than (or equal), empty, not empty, and in-list.

= How do I get support? =
Open **Products → StoreCanvas Lite help**. The support form there sends your ticket straight to the Tillpress support desk at tillpress.com after you tick the consent box and press Send ticket; you get a ticket number on screen and the reply comes by email. It includes your name, email, message, this site's address, and (optional) a system report of versions, theme, and active plugins; never passwords, keys, or customer data. Prefer email? "Email instead" opens the same ticket in your own email app. You can also use the WordPress.org support forum for this plugin or https://tillpress.com/support/. Replies Monday to Friday, 09:00 to 17:00 Pacific Time; first reply within one business day.

= Is there a demo? =
Yes. On **Products → StoreCanvas Lite help**, click **Create demo data**. It creates one hidden product (not in your shop or search) with lookup pricing, per-character engraving, a gift note that appears only when Gift wrap is ticked, option stock with a sold-out choice, and a reusable option group, so you can try the product page, live price, and cart. Everything is labelled "Demo", never emailed, and removed with one click (or when you uninstall the plugin).

= Does the plugin advertise anything? =
Only on its own Help & demo page: one box describing the paid StoreCanvas plugin with an optional 20% discount code. It can be hidden for good with "Hide this offer". There are no dashboard-wide notices, no tracking, and no referral IDs.

= What if I also install StoreCanvas (the paid plugin)? =
Lite steps aside automatically so you do not get duplicate option fields or double charges. You can deactivate Lite.

= What does the paid StoreCanvas add? =
The live design canvas (customers place artwork and text on product mockups), print-ready exports, and a production workflow — at https://tillpress.com/storecanvas/.

== Screenshots ==

1. Product page with option fields and the live price breakdown.
2. Product-edit StoreCanvas Lite tab: visual field builder with pricing and conditions.
3. Option groups: reusable fields assigned to products or categories.
4. Order screen showing the chosen options and options total.

== Changelog ==

= 1.0.10 =
* Includes 1.0.9 (option stock race, refund restock retry, stale product save).
* Plugin Check: Store API stock message escaped, refund restock flag unslashed and sanitized, stock compare-and-swap uses a prepared %i table placeholder.

= 1.0.9 =
* Fix: option stock sold by concurrent checkouts can no longer be overwritten by a later write.
* Fix: a refund whose restock failed is no longer marked done; retrying it restocks once.
* Fix: saving a product that was open while orders came in keeps the sold stock; a stock edit is applied as a change to the current amount.

= 1.0.8 =
* Fix: customized cart lines always use the current catalog price; a saved cart can no longer keep the old price after a catalog price change.

= 1.0.7 =
* Fix: option surcharges are applied once from the product's current price (including sale price). Recalculating the cart no longer stacks the same extra.
* Fix: option stock tracks each line and refund. Amount-only refunds do not restock; restock restores only the refunded quantity. Failed then paid orders re-reserve remaining stock.

= 1.0.6 =
* Fix: carts saved before this update are re-checked and re-priced from the current product options; invalid items are removed with a notice.

= 1.0.5 =
* Security: option quantities must be whole positive numbers; malformed values can no longer lower a price.
* Fix: option stock is counted across the whole cart, on quantity changes and at checkout; stock is reduced and restored once.

= 1.0.4 =
* Change: front-end option styles and the field-builder type lists now load through wp_enqueue_style / wp_add_inline_script instead of inline <style> and <script> tags (wordpress.org review).

= 1.0.3 =
* New: Send support tickets from inside the plugin (Help & demo page). You get a ticket number on screen; nothing is sent until you tick the consent box and press Send ticket. "Email instead" still opens your email app.

= 1.0.2 =
* New: Help & demo page (Products → StoreCanvas Lite help, also linked from the Plugins screen).
* New: one-click demo product and option group showing lookup, per-character, and flat pricing, a show-if field, and option stock. Hidden from the shop; removed with one click or on uninstall.
* New: support ticket form that opens a pre-filled email in your own email app, with an optional system report (no passwords, keys, or customer data). Nothing is sent from your site.
* New: optional, dismissible 20% offer for the paid StoreCanvas plugin, shown only on the Help & demo page.
* Fix: sold-out choices on radio and multi-select fields are now disabled on the product page (they were only blocked at add to cart). Radio choices show "(sold out)".

= 1.0.1 =
* Fix: show-if (conditional) fields now work on block themes such as Twenty Twenty-Five.
* Fix: order confirmation and emails show the customer's choices instead of raw sclt_price_extra.
* Fix: a plain Update on a product no longer deletes per-choice prices. Write prices as "Large=10".

= 1.0.0 =
* First public release: 15 field types, flat/percent/quantity/per-character/lookup pricing, multi-rule conditional logic, per-choice option stock, reusable option groups, live price preview.

== Upgrade Notice ==

= 1.0.4 =
Internal asset-loading change for wordpress.org review. No settings change.

= 1.0.3 =
Support tickets can now be sent from inside the plugin. No settings change.

= 1.0.2 =
Adds a Help & demo page: demo product, support form, and system report. No settings change.

= 1.0.0 =
First release.
