=== SecDev Buy One Get Extra for WooCommerce ===
Contributors: cannedbeans
Tags: woocommerce, purchase, get_extra
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically reward customers with free products when they purchase eligible items.

== Description ==

SecDev Buy One Get Extra for WooCommerce Automatically reward customers with free products when they purchase eligible items. Apply promotions to all products, selected categories, tags, or specific products.
The plugin automatically monitors the customer's cart and adds free reward products when the required quantity of eligible products is reached. Rewards are automatically updated when product quantities change and removed when the promotion requirements are no longer met.
You can apply promotions to all products, selected categories, product tags, or specific products. You can also exclude products and coupons, limit the number of free products per item or across the entire cart, and configure an alternative reward product.
Reward products are managed automatically and cannot be manually removed or have their quantity changed by customers.
The plugin works directly with the WooCommerce cart and keeps reward products synchronized with the current cart contents.

== Features ==

Automatically add free reward products to the cart
Quantity-based Buy One Get Multiple promotions
Apply promotions to all products
Apply promotions to selected product categories
Apply promotions to selected product tags
Apply promotions to specific products
Set a minimum quantity required to receive rewards
Configure reward quantities
Set a maximum free quantity per eligible item
Set a maximum total free quantity for the entire cart
Configure an alternative reward product
Exclude specific products from promotions
Exclude specific coupons from promotions
Automatically remove rewards when an excluded coupon is applied
Automatically update rewards when cart quantities change
Automatically remove rewards when the minimum quantity is no longer reached
Automatically remove rewards when the triggering product is removed
Prevent customers from manually removing reward products
Prevent customers from changing reward product quantities
Display an alternative reward message in the cart

== Installation ==

Upload the plugin to the /wp-content/plugins/ directory.
Activate the plugin through the Plugins screen.
Go to:
WordPress admin dashboard → SecDev - Buy One Get Extra

Enable the plugin.
Configure the desired options.
Save your settings.

== Settings ==

= Enable =

Enable or disable the Buy One Get Multiple promotion.

= Apply To =

Choose which products should be eligible for the promotion.

Available options may include:

All Products

Apply the promotion to all eligible products.

Categories

Apply the promotion only to products in selected WooCommerce product categories.

Tags

Apply the promotion only to products with selected product tags.

Products

Apply the promotion only to selected products.

= Minimum Quantity =

Set the minimum quantity of an eligible product required before a reward is added.

If the product quantity falls below this value, the associated reward is automatically removed from the cart.

= Reward Amount =

Configure the reward amount used to calculate the number of free products.

The reward quantity is calculated automatically based on the quantity of eligible products and your configured promotion rules.

= Maximum Free Quantity Per Item =

Limit the maximum number of free reward products that can be generated by each eligible cart item.

= Maximum Free Quantity Total =

Limit the total number of free reward products that can be added to the customer's cart.

This is useful when multiple eligible products are purchased.

= Alternative Reward Product =

Select an alternative product to be used as a reward when applicable.

= Alternative Reward Message =

Configure a message that can be displayed to customers in the WooCommerce cart regarding the alternative reward product.

= Excluded Products =

Select products that should not generate free rewards.

Even if these products would otherwise match the promotion rules, they will be excluded from the reward calculation.

= Excluded Coupons =

Select WooCommerce coupons that cannot be used together with the promotion.

When an excluded coupon is applied:

All reward products are removed from the cart.

No rewards are added while the excluded coupon remains active.


== How It Works ==

The plugin automatically synchronizes reward products with the WooCommerce cart.

A typical promotion works as follows:

A customer adds an eligible product to the cart.

The plugin checks whether the product matches the configured promotion rules.

The plugin checks whether the required minimum quantity has been reached.

The reward quantity is calculated.

A reward product is added to the cart automatically.

The reward product is made free.

If the cart changes, the reward is automatically updated or removed.


== Reward Management ==

Reward products are automatically managed by the plugin.

Customers cannot manually remove reward products from the cart.

Customers cannot manually change the quantity of reward products.

If the triggering product is removed, its associated reward is also removed automatically.

If the triggering product quantity falls below the required minimum quantity, the reward is removed.

If an excluded coupon is applied, all reward products are removed.

This ensures that free rewards always match the current promotion requirements.


== Frequently Asked Questions ==

= How does the plugin add free products? =

The plugin monitors the WooCommerce cart and automatically adds reward products when eligible products reach the configured minimum quantity.

= Can I apply the promotion only to specific products? =

Yes. You can configure the promotion to apply to specific products.

= Can I apply the promotion to product categories? =

Yes. You can select specific WooCommerce product categories that should participate in the promotion.

= Can I apply the promotion to product tags? =

Yes. You can configure the promotion to apply to products with selected product tags.

= Can I exclude certain products? =

Yes. Selected products can be excluded from generating rewards.

= Can I prevent certain coupons from being used with the promotion? =

Yes. You can configure excluded coupons. When an excluded coupon is applied, reward products are automatically removed from the cart.

= Can customers remove free reward products? =

No. Reward products are managed automatically by the plugin and cannot be manually removed by customers.

= Can customers change the quantity of reward products? =

No. The quantity of reward products is controlled automatically according to the promotion rules.

= What happens when the customer removes the triggering product? =

The associated reward product is automatically removed from the cart.

= What happens when the customer reduces the product quantity? =

The plugin recalculates the reward quantity. If the minimum quantity is no longer reached, the reward is removed.

= Can I limit the number of free products? =

Yes. You can configure both a maximum free quantity per eligible item and a maximum total free quantity for the entire cart.


== Screenshots ==

1. Plugin settings page
2. Cart page displaying rewards


== Changelog ==

= 1.0.0 =

Initial release.

Quantity-based Buy One Get Multiple promotions.
Automatic free reward products.
Product eligibility rules.
Category eligibility rules.
Tag eligibility rules.
Specific product eligibility.
Minimum quantity requirements.
Reward quantity calculation.
Maximum free quantity per item.
Maximum total free quantity.
Alternative reward products.
Alternative reward messages.
Excluded products.
Excluded coupons.
Automatic reward synchronization.
Automatic reward removal.
Protected reward products.


== Upgrade Notice ==

= 1.0.0 =

Initial public release.