=== Dreamfox Payment Gateway per Product for WooCommerce ===
Contributors: dreamfox
Tags: payment gateway, restrict payment methods, hide payment gateway, conditional payment, checkout
Requires at least: 5.8
Tested up to: 7.0.4
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 5.0
WC tested up to: 11.0.1
Stable tag: 3.8.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Control WooCommerce payment gateways per product, category, or tag. Show the right payment methods at checkout and increase conversions.

== Description ==

Take full control of your WooCommerce checkout with **Dreamfox Payment Gateway per Product for WooCommerce**.

This powerful plugin allows you to **show or hide payment gateways based on products, categories, or tags**, so your customers only see the most relevant payment options — exactly when it matters.

✅ **Works on both the classic checkout and the WooCommerce Block Checkout** (the `[woocommerce_checkout]` shortcode as well as the Cart & Checkout blocks) — your payment gateway rules are enforced everywhere your store checks out.

🚀 **Why this plugin?**
Default WooCommerce shows all payment methods to all customers. That often causes confusion, reduces trust, and increases cart abandonment.

With this plugin, you can:
- Show **PayPal only for specific products**
- Enable **Stripe for subscriptions**
- Limit **cash on delivery to certain categories**
- Create a **clean, optimized checkout experience**

👉 Result: **Higher conversions, better UX, and fewer abandoned carts**

---

== Key Features ==

✔ Assign payment gateways per **individual product**  
✔ Automatically fallback to **default gateways** when no match is found  
✔ Works with **PayPal, Stripe, credit cards, and all WooCommerce gateways**  
✔ Lightweight, fast, and easy to configure  
✔ No coding required  

✔* Control payment methods per **category**  
✔* Configure **tag-based payment rules**  
✔* Choose fallback behavior: show **no payment methods** or **default gateways**  

---

== Premium Features ==

Features marked with * are available in the Premium version.

🔥 Unlock full control over your WooCommerce checkout:

- ✔* **Per Product Payment Gateways**  
- ✔* **Category-Based Payment Rules**  
- ✔* **Tag-Based Payment Control**  
- ✔* **Flexible Fallback Options**  
  If no matching payment gateways are found at checkout, choose to:
  - Show no payment methods, or  
  - Show one of your default WooCommerce payment gateways  
- ✔* **Include / Exclude Logic**  
- ✔* **Advanced Checkout Optimization**  
- ✔* **Easy Setup (no coding required)**  

---

== Free vs Premium ==

|| Feature || Free || Premium ||
| Assign payment gateways per product | ✔ | ✔ |
| Default WooCommerce fallback | ✔ | ✔ |
| Category-based payment rules | ✖ | ✔* |
| Tag-based payment rules | ✖ | ✔* |
| Advanced include/exclude logic | ✖ | ✔* |
| Choose fallback behavior (none or default) | ✖ | ✔* |
| Priority support | ✖ | ✔* |

*Premium features are marked with *

---

== How It Works ==

1. Edit a product, category, or tag  
2. Select the allowed payment gateways  
3. Save your settings  

At checkout:
- Matching gateways are displayed  
- If no match is found → fallback behavior is applied (default or none)

Simple, powerful, and effective.

---

👉 Want more control, advanced features, and full flexibility over your checkout?

Explore documentation, premium features, and updates on our website:  
https://www.dreamfoxmedia.com

📚 Knowledge Base:  
https://help.dreamfoxmedia.com

🛠 Need help or support?  
Submit a request here:  
https://dreamfoxmedia.com/support-form/

---

== Installation ==

= Automatic Installation =
1. Go to **Plugins > Add New**
2. Search for `Dreamfox Payment Gateway per Product for WooCommerce`
3. Click **Install Now**
4. Activate the plugin

= Manual Installation =
1. Upload the plugin ZIP file
2. Extract to `/wp-content/plugins/`
3. Activate via **Plugins**

---

== Frequently Asked Questions ==

= What happens if multiple products have different payment gateways? =

The plugin intelligently combines allowed gateways.

Example:
- Product A → PayPal
- Product B → PayPal + Credit Card

👉 Checkout will show: **PayPal + Credit Card**

For more details, visit [Dreamfox Media](http://www.dreamfoxmedia.com).

---

= Where can I find documentation and support? =

You can find everything you need to get started and go further:

🌐 Website & Premium Features:  
https://www.dreamfoxmedia.com

📚 Knowledge Base (guides & tutorials):  
https://help.dreamfoxmedia.com

🛠 Support (submit a ticket):  
https://dreamfoxmedia.com/support-form/

---

= What happens if no payment gateway matches? =

If no matching payment gateways are found during checkout, you can control the behavior (Premium feature):

- Show no payment methods, or  
- Automatically fallback to one of your default WooCommerce payment gateways  

---

= Does this work with Stripe, PayPal, and other gateways? =

Yes. This plugin works with **all standard WooCommerce payment gateways and extensions**.

---

= Does this work with the new WooCommerce Block Checkout? =

Yes. This plugin works on both the classic checkout (`[woocommerce_checkout]` shortcode) and the WooCommerce Block Checkout (the Cart and Checkout blocks, WooCommerce's default checkout since version 8.3). Your per-product, per-category, and per-tag payment gateway rules — including the default-gateway fallback — are enforced identically on both.

---

== Screenshots ==
1. Choose the allowed payment gateways for an individual product, right from the Product data panel.
2. The plugin's Information tab, with an overview of what it does and links to related Dreamfox Media plugins.
3. Set a fallback payment gateway for when no per-product, per-category or per-tag match applies.
4. Checkout automatically shows only the allowed gateway(s) for the products in the cart.

== Changelog ==

= 3.8.4 =
- Renamed the plugin (display title only) to "Dreamfox Payment Gateway per Product for WooCommerce" — brings it in line with the "Dreamfox X for WooCommerce" naming already used across the rest of the plugin family. The WordPress.org slug, text domain, and install/update identity are unchanged, so this does not affect existing installs, licenses, or reviews.

= 3.8.3 =
- Added the `.wordpress-org` assets folder (banner, icon, screenshots) so the deploy workflow actually pushes them to the WordPress.org plugin listing — the 3.8.2 release built and shipped correctly but left the listing's banner/icon/screenshots untouched since that folder didn't exist yet.

= 3.8.2 =
- Settings screen: replaced the old JS-toggled tab UI with a real nav-tab-wrapper (matches the rest of the Dreamfox Media plugin family) — tabs are now plain page links, server-rendered per tab instead of all rendered and hidden with CSS.
- Information tab: rebuilt as a two-column layout with a refreshed hero image and a new "Screenshots" gallery (click a thumbnail to view it full-size).
- Renamed the "Settings" tab to "Default Gateway" to avoid duplicating Freemius's own "Settings" link in the tab bar.
- Fixed several dead dreamfoxmedia.com links on the Information tab.
- Rewrote the Information tab copy to be clearer and more scannable, and updated the readme Tags for better WordPress.org search relevance.

= 3.8.0 =
- Verified and declared compatibility with the WooCommerce Block Checkout (`cart_checkout_blocks`): the payment gateway filter now runs against a live WordPress 7.0.4 / WooCommerce 11.0.1 Block Checkout, confirming restricted/allowed gateways and the default-gateway fallback all behave correctly there, in addition to the classic checkout.
- Confirmed compatibility: tested up to WordPress 7.0.4 and WooCommerce 11.0.1.

= 3.7.9 =
- Confirmed compatibility: tested up to WordPress 7.0.1 and WooCommerce 10.9.4.

= 3.7.8 =
- Free version: removed the 2-category limit and the eligible-categories picker on the Settings tab.
- Show the per-product payment gateway selector on every product, regardless of category.
- Per-product gateway selection now takes priority over category, tag, and default fallback settings; when a product has no selection, the category/tag rules and default fallback apply.

= 3.7.7 =
- Show free-tier category picker on the Settings tab (was built but never rendered).
- Enable Save on the free version so categories and default payment can be stored.
- Merge settings on save so premium saves do not wipe unrelated keys.

= 3.7.6 =
- Update Freemius WordPress SDK to 2.13.2.

= 3.7.5 =
- Remove duplicate legacy category/tag save handlers (admin_post handlers are used).
- Fix Freemius helper functions to use dfm_pgppfw_fs() instead of my_fs().
- Enforce free-tier 2-category limit server-side on settings save.
- Wire is_product_eligible() to respect selected categories in the free version.
- Remove unused woocommerce_product_apply option tracking.
- Guard Composer autoload when Freemius SDK is already loaded.
- Show inline error on DFM Plugins tab fetch failure instead of wp_die().

= 3.7.4 =
- Tested with the latest WordPress (7.0) and WooCommerce (10.9.3) versions.

= 3.7.3 =
- Tested with the latest WordPress (6.9.4) and WooCommerce (10.7.0) versions.

= 3.7.1 =
- Bugfix.

= 3.7.1 =
- Tested with the latest WordPress and WooCommerce versions.
- Update freemius SDK to latest version
- Fixed bug using plugin on wordpress.com

= 3.6.5 =
- Tested with the latest WordPress and WooCommerce versions.
- Update freemius SDK to 2.12.2
- Fixed bug using plugin on wordpress.com

= 3.6.4 =
- Bug fixes and compatibility updates.
- Tested with the latest WordPress and WooCommerce versions.
- Update freemius SDK to 2.12.1

= 3.6.3 =
- Bugfix -> Payment options not visible by product in free version

= 3.6.2 =
- Bugfixes

= 3.6.0 =
- Update freemius SDK to 2.11.0

= 3.5.9 =
- Security issues solved

= 3.5.7 =
- Security issues solved

= 3.5.6 =
- Bug fixes and compatibility updates.
- Tested with the latest WordPress and WooCommerce versions.
- Update Freemius SDK to 10.2

= 3.5.5 =
- Bug fixes and compatibility updates.
- Tested with the latest WordPress and WooCommerce versions.

... (keep existing changelog entries here) ...

== Upgrade Notice ==
Upgrade to the latest version to ensure compatibility and access new features.
