=== Affiliate & Referral Program for WooCommerce By Javed ===
Tags: referral, affiliate, commissions, woocommerce, referral program
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.7.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Banner: assets/banner-1544x500.png


Easy referral and affiliate tools for WooCommerce with product referral links, short URLs, coupon tracking, affiliate signup, CSV tools, multi-level commissions, UPI details, and admin approval.

== Changelog ==

= 1.7.5 =
* Updated the plugin name to Affiliate & Referral Program for WooCommerce By Javed.
* Added a team-style admin menu icon.
* Added a referral flow GIF and refreshed plugin artwork.
* Added dashboard and Affiliate Tools screenshots to the documentation.

= 1.7.4 =
* Fixed the checkout coupon AJAX response so a successfully applied coupon is not incorrectly reported as a failed request.
* Added a clear "Coupon applied successfully" message and improved handling of WooCommerce validation responses.


= 1.7.3 =
* Fixed Refernix checkout coupon box visibility so the enabled setting reliably keeps the box visible.
* Removed theme-native coupon DOM auto-hiding that could make the Refernix box disappear after checkout refresh/AJAX updates.


= 1.7.1 =
* Added an admin setting to turn the Refernix checkout coupon box on or off.
* Keeps WooCommerce coupon functionality independent from the Refernix display setting.

== Description ==

Refernix – Referral Products for WooCommerce lets store owners run a simple product-based referral program without requiring a third-party referral service.

Customers get a Referral area inside WooCommerce My Account where they can:

* View their referral ID.
* Copy product-specific referral links.
* See total referrals.
* See Complete Earnings.
* See Pending Payment.
* View referral history and payment status.
* Add or update a UPI ID from Bank Details.

Store administrators can:

* Choose a fixed commission or percentage commission.
* Set the commission value.
* Set referral cookie duration.
* Configure the My Account referral endpoint.
* View pending referral payouts.
* See a referrer's saved UPI ID.
* Approve pending COD/manual-payment referrals.
* Use the built-in Documentation page for setup and troubleshooting.

== How It Works ==

1. A customer opens My Account → Referral.
2. The customer copies a product referral link.
3. A referred shopper opens the link and places an order.
4. A referral record is created as Pending.
5. Successful non-COD online payments are marked Paid automatically when WooCommerce confirms payment.
6. COD/manual-payment referrals stay Pending until the administrator approves them.
7. Approved commissions move into Complete Earnings.

The plugin records payout information but does not automatically transfer money through UPI or a bank.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin ZIP from Plugins → Add New → Upload Plugin.
3. Activate the plugin.
4. Open WooCommerce → Referral Settings.
5. Choose Fixed Amount or Percentage and set the commission.
6. Save the settings.
7. Customers can use My Account → Referral.
8. Customers can add their UPI ID under My Account → Bank Details.

If you change the referral endpoint slug, save Settings → Permalinks once.

== Configuration ==

=== Commission ===

* Fixed Amount: for example, 50 means a 50-unit commission per referred product line.
* Percentage: for example, 5 means 5% of the referred product line total.

=== Payment Status ===

* Pending: referral commission is recorded but not yet approved for payout.
* Paid: commission is included in Complete Earnings.
* Refunded: the related order was refunded.
* Cancelled: the related order was cancelled or failed.

COD orders are intentionally not auto-approved.

== Privacy ==

The plugin stores the referral ID generated for a user, the user's UPI ID when they choose to provide it, and referral/order records needed to operate the referral program.

The plugin does not send this information to an external server.

WordPress personal data export and erasure tools are supported for the plugin's stored referral data. Referral financial records may be anonymized rather than deleted when needed to preserve store accounting records.

== Frequently Asked Questions ==

= Does it work with Flatsome? =

Yes. The plugin uses WooCommerce My Account endpoints and standard WooCommerce hooks rather than theme-specific templates.

= Does it work with Elementor? =

Yes. The referral dashboard also provides a shortcode, `[refernix_referral_dashboard]`, for pages or layouts where a shortcode widget is available.

= Is COD automatically counted as paid? =

No. COD/manual-payment referrals remain Pending until the administrator approves them.

= Are online payments counted automatically? =

Yes, when WooCommerce confirms the payment for a non-COD gateway.

= Does the plugin make UPI payments automatically? =

No. It displays the saved UPI ID to the administrator. The actual payout is made manually through the administrator's preferred payment method.

= What happens if an order is refunded or cancelled? =

The related referral record is updated to Refunded or Cancelled.

== Screenshots ==

1. Referral dashboard with referrals, Complete Earnings, and Pending Payment.
2. Customer Bank Details page for adding a UPI ID.
3. Admin Referral Settings with commission configuration.
4. Admin pending payout list with UPI details and approval.

== Changelog ==

= 1.7.3 =
* Fixed Refernix checkout coupon box visibility so the enabled setting reliably keeps the box visible.
* Removed theme-native coupon DOM auto-hiding that could make the Refernix box disappear after checkout refresh/AJAX updates.


= 1.7.0 =
* Fixed checkout coupon application so the coupon is applied through WooCommerce without showing a false invalid message.
* Added duplicate coupon-form protection when a theme already provides WooCommerce’s native checkout coupon form.
* Preserved Refernix coupon-to-affiliate attribution after successful coupon application.


= 1.6.9 =
* Fixed checkout coupon application so Apply Coupon uses WooCommerce AJAX without placing the order.
* Added automatic checkout coupon box and preserved Refernix coupon referral attribution.


= 1.6.8 =
* Added an All Referrals admin view from the Total Referrals card.
* Shows referrer name, referred buyer, contact details, order count and commission.
* Multiple orders from the same buyer remain grouped as one unique referral.


= 1.6.7 =
* Referral URLs can generate unlimited qualifying orders.
* User and admin referral counts now deduplicate buyers by billing mobile + email instead of blocking subsequent orders.


= 1.6.6 =
* Fixed referral tracking so multiple different buyers can use the same referral link while the same buyer is counted only once.
* Added a stored buyer identity fingerprint for reliable duplicate referral protection.

= 1.6.4 =
* Prevent duplicate referral counts when the same buyer places multiple orders with the same affiliate.
* Duplicate detection matches full name, billing address, phone number and email together.
* Different buyers using the same referral link continue to count separately.
* Referral totals count unique referral orders.


= 1.6.3 =
* Fixed referral order tracking across classic checkout, payment status changes, short URLs, and WooCommerce Blocks/Store API checkout.
* Referral attribution is now persisted in both the browser cookie and WooCommerce session.
* Order referral creation is idempotent and safely re-checks successful orders.

= 1.6.2 =
* Fixed referral order tracking so successful orders are reliably linked to the referrer during checkout and payment flows.
* Added WooCommerce session fallback for referral attribution.

= 1.6.1 =
* Improved short referral links with a rewrite fallback.
* Added percentage or fixed-amount choices for level 2 and level 3 commissions.
* Improved the admin Referral Dashboard with colored four-column desktop cards.
= 1.6.0 =
* Added easy affiliate tools: short referral URLs, coupon-based tracking, affiliate signup form, CSV import/export, URL generator, and optional multi-level commissions.
* Added a compact admin dashboard with total referrals, pending, approved, and not-approved counts.
* Kept the existing referral dashboard, approval workflow, COD handling, and referral data intact.


= 1.5.7 =
* Corrected the plugin display name to Referral Product for WooCommerce By Javed.

= 1.5.6 =
* Corrected the WordPress.org release package so the complete Referral Manager, approval workflow, successful-order filtering, COD/manual-payment handling, and non-destructive uninstall behavior are included in the release.
* Preserved existing referral data and settings during plugin updates.

= 1.5.5 =
* Added the Referral Manager admin menu with Dashboard, Pending Payments, Approved, Not Approved, Settings, and Documentation sections.
* Added Approve and Not Approved actions for pending referral payouts.
* Limited pending payouts to referrals attached to successful orders.
* Added safer COD/manual-payment pending handling.
* Made plugin uninstall non-destructive so referral data and settings are preserved.

= 1.5.2 =
* Finalized WordPress.org review metadata and prefix audit cleanup.


= 1.5.1 =
* Added a safe migration for legacy plugin data and standardized plugin prefixes to prevent naming collisions.

= 1.5.0 =
* Rebranded the plugin to Refernix – Referral Products for WooCommerce.
* Updated the plugin slug and text domain.


= 1.4.8 =
* Restored the COD/manual-payment workflow: referrals stay Pending until the admin clicks Approve Payment.
* Added payment method visibility to the pending referral payout table.


= 1.4.7 =
* Restored and clarified the admin payment approval workflow.
* Added referral payment history with Pending and Payment Approved / Paid statuses.


= 1.4.6 =
* Packaging and WordPress.org metadata cleanup: plugin directory slug, text domain, version, and stable tag are now consistent.


= 1.4.4 =
* Cleaned Plugin Check annotations and SQL query handling.
* Fixed malformed inline PHPCS comments that could become part of SQL strings.
* Improved compatibility of the plugin source with WordPress.org review tooling.


= 1.4.0 =
* Added customer Bank Details page with UPI ID.
* Added UPI ID to the admin pending payout table.
* Added built-in Documentation page.
* Added WordPress personal data export and erasure support.
* Added clearer setup and payment-status guidance.
* Prepared the plugin metadata and documentation for WordPress.org distribution.

== Support ==

For support, use the plugin's WordPress.org support forum after the plugin is approved and published.
