=== thevitaminshots Refunds & Returns for WooCommerce ===
Contributors: thevitaminshots
Tags: woocommerce refund, woocommerce returns, refund request, return request, rma
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Customer-facing refund and return request system for WooCommerce with configurable percentages, dual tax modes, and admin approval workflow. Free.

== Description ==

**A complete refund and return request system for your WooCommerce store — free, GPL, and completely customizable.**

Customers submit refund or return requests through a beautiful shortcode-based form. They enter their order number, get verified, describe the issue, and submit. You review the request in your WordPress admin, approve or deny it, and the customer gets notified automatically.

Perfect for stores that want a proper RMA (Return Merchandise Authorization) flow without the complexity of enterprise-grade tools.

= Why store owners love it =

* **Configurable refund percentage** — 100% full refunds, 50% partial refunds, or any value from 0 to 100
* **Two tax modes** — use your existing WooCommerce tax settings, OR upload a US ZIP-based CSV for granular tax lookup
* **Order verification** — customers must provide the order number AND matching email before they can submit
* **Excluded categories** — auto-hide products in categories like "Gift Cards" or "Bundles" from refund forms
* **Return windows** — enforce a "returns must be requested within X days of purchase" policy
* **Email notifications** — customer gets a confirmation, admin gets alerted; both are configurable
* **Beautiful admin dashboard** — filter by status/type, view details, approve/deny with one click
* **Fully translation-ready** — text domain, `.pot` generation supported

= Features =

* Two-in-one: **refund requests** AND **return requests** in the same plugin
* Requires WooCommerce (versions 5.6 to 8.x tested)
* Six tabs of settings: General, Refund, Return, Tax, Notifications, Advanced
* Customer form with three-step flow: Order lookup → Details → Submission confirmation
* Configurable refund percentage from 0% to 100%
* Two tax calculation modes: WooCommerce built-in tax rates OR CSV-based ZIP lookup
* Category exclusion (products in specific categories won't appear in refund forms)
* Return window enforcement (configurable 1-365 days)
* Optional evidence requirements: photo uploads and/or video URL
* Six default return reasons (defective, wrong item, not as described, no longer needed, damaged in shipping, other) — pick which ones to offer
* Automatic customer confirmation email on submission
* Automatic customer status-update email when admin approves or denies
* Admin notification email routing
* Customizable form title, subtitle, and success message
* Accent color customization (matches your brand)
* Admin dashboard with filtering by status and type
* One-click approve/deny buttons with optional admin notes
* WooCommerce order lookup by numeric ID or custom order number
* Lightweight: under 80 KB total
* Free and open-source under GPL v2

= Use cases =

* **E-commerce stores** — give customers a self-service refund/return portal
* **Subscription businesses** — handle first-time-only refund policies (100% for first order, X% for subsequent)
* **Digital goods stores** — 50% or 25% partial refund policies with clear documentation
* **Physical goods stores** — full RMA workflow with photo/video evidence
* **Multi-region US stores** — precise per-ZIP tax refunds with CSV upload
* **International stores** — use WooCommerce's built-in tax settings for automatic global tax handling

= Compatibility =

Works with **Elementor**, **Divi**, **Beaver Builder**, **Bricks**, **Gutenberg**, and the Classic Editor. Just paste the shortcode `[tvsret_form]` anywhere on your site. Tested on WordPress 5.6 through 7.0. Requires WooCommerce.

== Source Code ==

All JavaScript and CSS files in this plugin are the actual source — nothing is minified or compiled. Every file in the plugin folder is human-readable production code.

For updates and documentation: https://thevitaminshots.com/plugins/

== External services ==

This plugin does not connect to any external services controlled by the plugin author. All data (requests, tax rates, settings) is stored in your own WordPress database.

The plugin uses only WooCommerce's own internal APIs (for order lookup, product data, and tax calculation) and WordPress core APIs (for options, database, and email). No third-party servers, no analytics, no telemetry.

If the store owner enables the CSV tax mode, the plugin reads tax rates from a CSV file that the store owner uploads directly through the admin panel. No CSV file is downloaded from any external source by the plugin.

== Installation ==

1. Install and activate WooCommerce (required).
2. Upload the plugin folder to `/wp-content/plugins/`, or install through the WordPress Plugins screen.
3. Activate the plugin.
4. Go to **Refunds & Returns → Settings** to configure.
5. Choose a page in the "General" tab OR paste the shortcode `[tvsret_form]` anywhere.
6. Save. Customers can now submit requests.

== Frequently Asked Questions ==

= Is this really free? =

Yes. 100% free forever. Every feature listed is included in the free version. No premium tier, no paid add-ons, no locked features. GPL v2 licensed.

= Does it work without WooCommerce? =

No. WooCommerce is required — the plugin uses WooCommerce for order lookup and product data. If WooCommerce is not active, an admin notice appears and the plugin stays inactive.

= Can I set the refund percentage to something other than 50% or 100%? =

Yes. In **Settings → Refund**, you can set any percentage from 0 to 100, in decimal increments (e.g., 25.5%).

= How does tax calculation work? =

Two modes. **WooCommerce mode** (default, recommended): the plugin uses your existing WooCommerce tax settings — the same rates already applied at checkout. **CSV mode**: upload a CSV of ZIP codes and tax rates (US-focused). Choose in **Settings → Tax**.

= What CSV format is supported for tax uploads? =

The CSV must include columns for `ZIP` (or `zip_code`) and `Tax_Rate` (or `combined_rate`). A `State` column is also read if present. Both percent values (`9.75`) and decimal values (`0.0975`) are accepted — the plugin auto-detects.

= Can customers upload photos with their request? =

Video URL uploads are supported in v1.0. Photo attachment uploads are planned for a future release. If your policy requires photo evidence, you can enable "Require photos" now and the form will require the customer to describe photos in the details field — future updates will add direct uploads.

= What data does the plugin store? =

Only what's necessary: the customer's name and email (from the verified order), the order number, the products selected, the reason for return, the calculated refund amount, and the admin's decision. All data lives in your WordPress database in two tables (`{prefix}tvsret_requests` and `{prefix}tvsret_tax_rates`).

= Will uninstalling delete my data? =

By default, no. Uninstalling only removes the plugin files. If you want to delete all data, enable "Delete all plugin data on uninstall" in **Settings → Advanced** BEFORE uninstalling.

= Does it work with custom order numbers? =

Yes. The plugin recognizes both the default WooCommerce numeric order IDs AND custom order numbers set by plugins like "WooCommerce Sequential Order Numbers".

= Can I customize the form's colors? =

Yes. Set the accent color in **Settings → General**. The form's header, buttons, and active tab all use this color.

= Are the emails customizable? =

The success message shown to customers is customizable in **Settings → General**. Email subject lines and body copy use translation strings — you can override them with a translation file or a `.pot`-based localization.

= Does it support multiple languages? =

Yes. The plugin is fully translation-ready. Text domain: `thevitaminshots-refunds-returns-for-woocommerce`. Use WP-CLI or Loco Translate to add translations.

= Where can I get support? =

Support forum: https://wordpress.org/support/plugin/thevitaminshots-refunds-returns-for-woocommerce/

== Screenshots ==

1. Admin dashboard — filter requests by status and type
2. Settings — General tab
3. Settings — Refund tab with configurable percentage and category exclusions
4. Settings — Tax tab showing dual mode selector
5. Customer-facing form — step 1, order verification
6. Customer-facing form — step 2, refund calculation with breakdown
7. Email notification example

== Changelog ==

= 1.2.1 =
* Removed load_plugin_textdomain() call — no longer needed for WordPress.org hosted plugins since WP 4.6.

= 1.2.0 =
* New: "Email → Order dropdown" lookup mode — customers enter their email and pick from a dropdown of their recent orders (with strict order#+email mode still available as the more privacy-safe default).
* New: Photo uploads — customers can attach up to 10 photos (JPG/PNG/WebP, 5MB each) as evidence for return requests. Files stored in your WordPress uploads folder under /uploads/tvsret/.
* New: Separate "Allow" and "Require" settings for photos and video URL — you can now enable photo/video fields without making them mandatory.
* New: Configurable max photos per request (1-10).
* New: "Auto-approve requests" setting — automatically approve all requests on submission, skipping manual review.
* New: Rate limiting on public lookup endpoints (10 requests per hour per IP) to prevent enumeration attacks.
* New: Privacy-safe order search limited to last 6 months of orders in email-only mode.
* Fixed: Photo evidence now actually uploads and stores (v1.0 stored URL only).

= 1.1.0 =
* Major frontend redesign — form is now genuinely beautiful and highly customizable.
* New "Design" tab in Settings with ~25 visual controls: layout, colors, shape, typography, header style, header icon, progress indicator style, button style, field style, animations.
* Live preview panel in the Design tab — see your changes on the customer form in real time as you configure, without saving.
* Desktop and mobile preview toggle.
* New "Content" tab — every label, button, and heading on the customer form is now editable.
* CSS variables system — all styling driven by design tokens for consistency between preview and live form.
* Six bundled header icons (refund arrow, box, shield, cart, checkmark, or custom image URL).
* Progress indicator with three styles: numbered steps, dots, or bar.
* Field styles: outlined, filled, or underlined.
* Button styles: solid, gradient, or outlined.
* Shadow depth control from none to dramatic.
* Full color customization: accent, text on accent, background, text, muted, border colors.

= 1.0.0 =
* Initial release.
* Merged refund and return request workflows into a single plugin.
* Two tax calculation modes: WooCommerce built-in and CSV-based ZIP lookup.
* Configurable refund percentage (0-100%).
* Six-tab settings interface.
* Admin dashboard with filtering and one-click approve/deny.
* Customer three-step form with order verification.
* Category exclusion for refund eligibility.
* Return window enforcement.
* Email notifications for customer and admin.
* Full translation-readiness.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
