=== Tryvertising ===
Contributors: zentraglow
Tags: woocommerce, samples, product samples
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Offer free product samples with store credit to turn tasters into buyers.

== Description ==

Tryvertising adds sample ordering to a WooCommerce store. On a product that has samples enabled, customers see an "Order a sample" button. They can order a free sample, a paid sample, or a mix set by the shop: a set number of free samples first, then paid samples after that.

What the free version does:

* Set a sample price per product or per variation, free or paid.
* Offer a set number of free samples first, then charge for further samples (tiered free-then-paid).
* Limit how many samples a customer can order per order and per customer.
* Keep sample orders sample-only: a cart that contains samples cannot also contain full-priced products, and a cart with full-priced products cannot add samples.
* Sell swatch packs: a pack product made up of sample components.
* Issue an automatic, single-use sample-credit coupon when a paid sample order is completed. The coupon is for the sample amount only, is restricted to the sampled products, and expires after 30 days.
* Show a sample-to-full conversion report under WooCommerce > Sample Conversion, so you can see which sampled products led to full orders.

The credit is calculated net of tax. If part of a sample order is refunded, the credit is reduced to match what was kept; if the sample is fully refunded, the coupon expires.

Please note the limits that apply to this version:

* Classic forms only. This plugin works with the classic cart and checkout. It declares the cart and checkout blocks incompatible, and the sample button does not render on a block theme.
* Guests cannot redeem an email-restricted sample-credit coupon. A coupon issued for a sample order is tied to the email address used for that order. A guest customer must log in with the sample email address before the coupon can be used at checkout.
* This plugin requires WooCommerce 8.8 or later, and has been tested with WooCommerce up to 11.2.1.

== Installation ==

1. Make sure WooCommerce is installed and active.
2. Upload the `tryvertising` folder to the `/wp-content/plugins/` directory, or install it through the WordPress plugins screen.
3. Activate the plugin through the Plugins screen in WordPress.
4. Go to WooCommerce > Tryvertising to set the default sample button label and other defaults.
5. Edit a product and enable samples for it: set the sample price, how many free samples are included, and the per-order and per-customer limits. For a swatch pack, create a pack product and add its sample components.
6. View results under WooCommerce > Sample Conversion, and manage packs under WooCommerce > Sample Packs.

== Frequently Asked Questions ==

= How does the sample credit work? =

When a paid sample order is completed, the plugin creates a single-use coupon for the amount paid for the sample, restricted to the sampled products. The customer uses that coupon on a later full order of the same product. The coupon expires after 30 days.

= Can a customer mix samples and full products in one cart? =

No. Sample carts are sample-only. If a cart already contains samples, full-priced products cannot be added, and if a cart already contains full-priced products, samples cannot be added.

= Why can't a guest use a sample-credit coupon? =

Sample-credit coupons are restricted to the email address used for the sample order. WooCommerce checks that restriction against a logged-in customer. A guest has no email address on file at the cart stage, so the coupon cannot be validated for a guest. Log in with the sample email address, and the coupon can then be used at checkout.

= What happens if a sample order is refunded? =

A partial refund reduces the credit to the amount kept. A full refund expires the coupon. The conversion report reflects refunds.

= Does this work with the block cart and checkout? =

No, not in this version. This plugin is classic-forms only and declares the cart and checkout blocks incompatible.

= What is a swatch pack? =

A pack product whose components are samples of other products. Customers order the pack as a sample, and the credit rules for its components apply as for single samples.

== Changelog ==

= 1.0.3 =
* New name: Tryvertising, with the tryvertising slug and text domain.
* Added the Requires Plugins header declaring WooCommerce as a dependency.
* All internal prefixes lengthened to tryv_ / TRYV_ per review feedback; sample coupon codes now start with TRYV- (older SC- test coupons are still recognised).

= 1.0.2 =
* First release on WordPress.org.
* Per-product and per-variation sample pricing, free or paid, with tiered free-then-paid samples.
* Per-order and per-customer sample limits, and sample-only carts.
* Swatch packs.
* Automatic single-use sample-credit coupon on completed paid sample orders, restricted to sampled products, expiring after 30 days, calculated net of tax, with a fail-closed limit so the coupon cannot discount non-sampled products.
* Sample-to-full conversion report.
* Requires WooCommerce 8.8 or later; tested with WooCommerce up to 11.2.1. Classic cart and checkout only.
