=== Smart Coupons For WooCommerce Coupons ===
Contributors: WebToffee
Version: 1.6.1
Donate link:https://www.webtoffee.com/plugins/
Tags: WooCommerce coupon, BOGO, url coupons, gift coupons, signup coupons, coupons, smart coupons, advanced coupons, woocommerce smart coupons, woocommerce, url coupons for woocommerce,  extended coupons, auto coupons,  smart coupons for woocommerce,  coupon category
Requires at least: 3.3
Tested up to: 6.4
Requires PHP: 5.6
Stable tag: 1.6.1
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Add advanced options to WooCommerce coupons that offer BOGO discounts, auto-apply coupons, giveaway products, coupons for specific shipping methods, payment methods, user roles and many more.

== Description ==

= ADVANCED WOOCOMMERCE COUPONS PLUGIN =

Smart Coupons for WooCommerce Coupons adds advanced options to default WooCommerce Coupons that let you create BOGO deals, a variety of coupon restrictions, enable auto-apply of coupons, giveaway offers, easy coupon management, and more.

**See how the plugin works: <a rel="nofollow" href="https://tastewp.com/new?pre-installed-plugin-slug=woocommerce&pre-installed-plugin-slug=wt-smart-coupons-for-woocommerce&redirect=admin.php%3Fpage%3Dwt-smart-coupon-for-woo&ni=true">Try out demo</a>** 

= WooCommerce BOGO deals =

The free plugin Smart Coupons for WooCommerce is a go-to plugin for setting up WooCommerce BOGO coupons. Quantity based discounts being an imperative strategy for promoting sales, you can use this WooCommerce BOGO coupon plugin for offering various price based or percentage discounts. 

Another peculiarity of this WooCommerce BOGO coupon plugin is that it will allow you to offer full and partial discounts. You can choose specific products for which a BOGO coupon must be applied as well as those that are free.

In fact, you can choose to apply the WooCommerce BOGO coupon repeatedly for Buy 2 Get 1, Buy 4 Get 2, and so on. As and when the cart meets the BOGO coupon criteria, the coupon will automatically be applied.

##New Updates##
* <strong> WooCommerce BOGO deals</strong>: Offer different types of BOGO discounts in WooCommerce such as Buy One Get One, Buy 2 Get 1 for 50% off, Buy 2 Get 2, Buy 2 Get 1 for $100 off, Schedule a begin and end dates for the BOGO offer, Exclude products from applying BOGO and many more.
* <strong>Full or partial discounts</strong>: BOGO with percentage (%) or price discount on the second item, after spending a certain amount and also for specific products.
* <strong> WooCommerce Block compatibility </strong>: Compatible with WooCommerce Cart Block and Checkout Block for WordPress Block themes.


###Major Features: Smart Coupons For WooCommerce Coupons###

* <strong>Auto-apply of coupons</strong>: Create smart coupons that can be [applied automatically](https://www.webtoffee.com/how-to-auto-apply-coupon-on-checkout-in-woocommerce/) when a product is added to the cart.

* <strong>View coupons from My-Account page</strong>: Make the WooCommerce discount coupons available in the user’s account so that they can view applicable coupons from My Account > My Coupon.

* <strong>Apply coupon restrictions</strong>: Restrict coupon usage on the basis of products, categories, and user roles.

* <strong>Create product quantity/subtotal based discounts</strong>: Filter coupons further with [maximum or minimum quantity/subtotal of products](https://www.webtoffee.com/how-to-offer-quantity-based-discounts-in-woocommerce/) purchased.

* <strong>Shipping, Payment and User Role-based coupons</strong>: Issue coupons with various checkout options such as [shipping methods, payment methods, or applicable user roles](https://www.webtoffee.com/how-to-offer-discounts-based-on-shipping-payment-or-user-role/).

* <strong>Giveaway coupons</strong>: Embed [giveaway products](https://www.webtoffee.com/how-to-offer-giveaway-in-woocommerce/) to coupons.

* <strong>Categorize coupons</strong>: Organize your WooCommerce coupons using coupon categories.

* <strong>Coupon customization</strong>: Customize coupon appearance with categorized coupon styling options for expired, used, and active coupons.

* <strong>Create duplicate coupons</strong>: Easily duplicate coupons using the same parameters as existing ones.

* <strong>Create coupon URLs</strong>: Generate coupon URLs to make promoting coupons easy.

* <strong>Offer ‘seasonal discount offer’</strong>: Allow to [set a start date and an end date](https://www.webtoffee.com/how-to-offer-seasonal-discounts-in-woocommerce/) for coupons so that you can offer ‘seasonal discounts’.

* <strong>Displays available coupons on cart and checkout page</strong>: The customers can view the available coupons from the cart as well as from the checkout page.

* <strong>Coupon shortcodes</strong>: Shortcodes are auto-created for all coupons in your store. You can use coupon shortcodes to display the coupon code, description, or discount info derived from the coupon settings anywhere on your site.


###Smart Coupons For WooCommerce Coupons - User Guide###
To get more details on how to set up this WooCommerce Smart Coupons plugin, please read [Smart Coupons for WooCommerce user guide](https://www.webtoffee.com/smart-coupons-for-woocommerce-userguide/ "Smart Coupons for WooCommerce user guide").


### NEED FOR THE WOOCOMMERCE SMART COUPONS PLUGIN ###

The success of every online store depends hugely on how well they market their products. Even if your store sells higher quality products at a reasonable price, improper marketing will keep your sales always on the downside. Thus coming up with the most appropriate marketing strategies from time to time is necessary to keep your store on the move. This WooCommerce smart coupon plugin is an essential tool for it.

If you are looking for the smartest way to market your products you should go for an advanced coupons plugin such as Smart Coupons for WooCommerce.

People always love getting more than what they pay for. Hence, coupons without a doubt help your store to improve sales by establishing a new customer base. Coupons can also be used to retain your existing customers. This, in turn, arises the need for an effective coupon management system which you can accomplish by adding a WooCommerce smart coupons plugin to your store.

### HOW CREATING ADVANCED COUPONS USING SMART COUPONS BENEFITS YOUR WOOCOMMERCE STORE ###

<strong>Easily apply coupons</strong>: Each Coupon has a coupon code associated with it. Usually, Customers are required to enter this code in the allowed field for applying a coupon to their purchase. However, this task can be made shorter by smart coupons as it displays all the coupons available for the customer on the Cart & My Account page to easily apply them.

<strong>Absolute self-management of everything related to coupons</strong>: Everything related to coupons will be managed automatically. The issuing of product coupons, coupon removal, etc., will be managed on its own thereby reducing the workload of the store admin.

<strong>Promote specific payment or shipping methods</strong>: Provide coupons based on payment or shipping methods that are most suitable for your business needs. This could also give room for partnership options with the respective vendor from a business perspective.

<strong>Duplicate coupons</strong>: If new coupons having configurations similar to any of the existing coupons need to be created, you can simply duplicate them instead of creating them from scratch.

##PREMIUM VERSION FEATURES##

* Smart Coupon for WooCommerce is an advanced [WooCommerce coupon plugin](https://www.webtoffee.com/product/smart-coupons-for-woocommerce/) that provides extensive options to set up discounts in WooCommerce.
* Configure the coupons with **extensive usage restrictions and checkout options**
* Enhanced **BOGO deals (Buy X Get X/Y)** with multiple giveaway options. Gives options to offer varied quantity or price-based discounts such as Buy X and Get the same product/any product from store/specific product from store/product from a specific category, etc.
* Create **purchase history based coupons/discounts** (first order/next order/nth order coupons)
* Create WooCommerce **bulk discount coupons** with add to store/email/export to CSV options
* **Giveaway multiple free products** with WooCommerce coupons
* **Import WordPress coupons**
* Create **cart abandonment coupons**
* Create **signup coupons**
* Ability to impose coupon **usage restrictions on the basis of the country/location** precisely with shipping or billing address apart from the default restrictions.
* Provision to **upload and import coupons** by simultaneously emailing it directly to the recipients.
* Create and design **gift vouchers** of any amount range by associating a store credit product.
* **Manage store credits** – create/purchase/transaction history/issue refunds/email.
* Display applicable coupons on the **Cart** page. 
* Provision to use **combo coupon** for purchase.
* **Coupon shortcodes** for displaying all available coupons for individual users. You may use the shortcode [wt_sc_user_available_coupons] for this purpose.


For a complete list of advanced WooCommerce coupon features and details, please visit [Smart Coupons for WooCommerce](https://www.webtoffee.com/product/smart-coupons-for-woocommerce/).


###URL coupons###

Smart coupons for WooCommerce plugin come with a URL coupons feature that helps you add a unique URL to any coupon in your WooCommerce store. Clicking this URL ensures that the underlying coupon is applied as per its respective configuration eg: allow discounts, giveaway free product, etc. 

Usage: {site_url}/?wt_coupon={coupon_code}

eg: https://www.example.com/cart/?wt_coupon=flat30

A URL coupon that offers a flat 30% discount at www.webtoffee.com, coupon_code = FLAT30, site_url (preferably cart page) = https://www.example.com/cart

### URL Coupons for WooCommerce Add-on ###
URL coupons for WooCommerce is a paid add-on that adds advanced URL coupon features to both the free and pro versions of the Smart Coupons for WooCommerce plugin. 

The following video explains the setup and workflow of the URL coupons for WooCommerce add-on.
[youtube https://www.youtube.com/watch?v=80JyXvalx6E]

<strong>Major features - URL Coupons for WooCommerce </strong>


* Pass coupon via a link that will redirect to the cart/checkout page with products added to it.
* Ability to create customized URLs with personalized text. For example, www.mystore.com/happybirthday.
* Embed URL coupon in a QRCode

For a complete list of features and details, please visit [URL Coupons for WooCommerce](https://www.webtoffee.com/product/url-coupons-for-woocommerce/)


== Installation ==

This section describes how to install the plugin and get it working.

e.g.

1. Upload `wt-smart-coupon.php` to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Place `<?php do_action('plugin_name_hook'); ?>` in your templates



== Frequently Asked Questions ==

= Can I offer WooCommerce coupons based on payment methods?=

Yes.

= Does it support coupon duplication? =

Yes, in order to duplicate a coupon, go to WooCommerce > Coupons. Find the coupon you wish to duplicate. Hover on the coupon and select Duplicate

= How to hide my coupons in my account list =

Please try adding the below code snippet to your active child theme’s functions.php

`add_filter('woocommerce_account_menu_items','wt_removed_un_wanted_my_account_tabs',100,1);
function wt_removed_un_wanted_my_account_tabs( $items ) {
   if( isset($items['wt-smart-coupon']) ) unset( $items['wt-smart-coupon'] );
   return $items;
}`
= Can I create quantity based WooCommerce coupons using this plugin?

Yes. This WooCommerce coupon plugin lets you create BOGO discounts of different types.

= Can I offer BOGO deals in WooCommerce using this plugin?

Yes. You can use this WooCommere advanced coupon plugin to offer discounts such as Buy One Get One, Buy 2 Get 1 at $100 off, Buy 1 Get 1 at 50% off, and many more.

= Is it possible to generate coupon URLs using the plugin?

Yes. You can generate coupon URL's using the following format.
{site_url}/?wt_coupon={coupon_code}

= Can I create WooCommerce coupons based on subtotal?

Yes. You can create coupons that get applied as per the purchase amount of a customer. 


== Screenshots ==

1. View coupons from My Account
2. BOGO discount applied in cart (same product)
3. Specific product discount (storewide)
4. Price based discount (subtotal amount)
5. Quantity based discount (Buy 2 get 20% off)
6. Shipping method based coupon
7. Various coupon layouts
8. URL Coupon
9. Set up 'Seasonal Discount' with start and end date
10. Group coupon based on category
11. Shipping/Payment/User role-based coupons
12. Giveaway free product for purchase
13. Coupons list
14. Coupon edit window


== Changelog ==

= 1.6.1 - 2024-02-13 =
* [Fix] Auto coupon not working on pages other than cart and checkout.
* [Fix] Checkout validations are not working.

= 1.6.0 - 2024-02-05 =
* [Fix] - Minimum subtotal calculation issue. Skipped the excluded products/category and sale items (If exclude sale items enabled).
* [Fix] - Issue when calculating the expiry time for auto coupons.
* [Compatibility] - Checkout block compatibility.
* [Compatibility]  - Cart block compatibility.
* [Compatibility] - Tested OK with WooCommerce 8.5

= 1.5.2 - 2023-11-20 =
* [Compatibility] - Tested OK with WordPress 6.4
* [Compatibility] - Tested OK with WooCommerce 8.3

= 1.5.1 - 2023-10-25 =
* [Fix] - Click to apply coupon is not working when coupon metabox added via shortcode
* [Fix] - Unable to add multiple variations of a product when `apply repeatedly` is enabled on the `Specific product` giveaway.
* [Compatibility] - Tested OK with WooCommerce 8.2

= 1.5.0 - 2023-09-21 =
* [Improvement] - Add Giveaways automatically to the cart when no variable product is chosen as a giveaway.
* [Compatibility] - Tested OK with WooCommerce 8.1

= 1.4.9 - 2023-07-31 =
* [Fix] - The auto-apply coupons are not applied until the payment method is changed
* [Compatibility] - WP 6.3

= 1.4.8 - 2023-06-27 =
* [Add] - Click to apply coupon
* [Compatibility] - Tested OK with WooCommerce 7.9

= 1.4.7 - 2023-06-16 =
* [Fix] - Used and expired coupons are not listed on the My Account page.
* [Improvement] - Coupon block HTML preparation.
* [Improvement] - jQuery deprecated functions changed.
* [Improvement] - Coupon settings DB structure made the same as in the premium version.
* [Compatibility] - Tested OK with WooCommerce 7.8

= 1.4.6 - 2023-03-30 =
* [Add] Country wise restriction for coupons
* [Bug fix] Coupon start date not showing properly on different timezones.
* [Compatibility] WC 7.5

= 1.4.5 - 2023-02-21 =
* [Add] New filter: `wt_sc_alter_giveaway_product_price` to alter giveaway product price.
* [Add] New filter: `wt_sc_chosen_shipping_for_validation` to process the shipping method name for validation.
* [Improvement] Added compatibility for shipping method value that has no `colon`
* [Improvement] Added WPML compatibility for giveaway products.
* [Improvement] Compatibility when adding product wise discounts(not via coupon) in the back-end.
* [Compatibility] WooCommerce HPOS.
* [Compatibility] WC 7.3

= 1.4.4 - 13-01-2023 =
* [Bug fix] Lookup table int column size issue. Few columns converted from int to bigint
* [Bug fix] BOGO product quantity was not updated correctly when different eligible products are added
* [Bug fix] Displaying coupons that are expired in the same date.
* [Bug fix] Giveaway product alignment issue in small screens.
* [Bug fix] Showing non-existing coupons.
* [Improvement] Lookup table migration code updated to handle very slow websites. New filter added to control migration batch limit. wt_sc_lookup_table_migration_batch_limit
* [Improvement] Coupon restriction compatibility added for backend coupon applying
* [Improvement] Custom warning message added, if lookup table not exists
* [Add] Search coupons using email
* [Add] New filter: `wt_sc_auto_coupons_list` to alter auto coupon list.
* [Compatibility] WC 7.2

= 1.4.3 - 09-11-2022 =
* [Improvement] Coupon fetching and displaying optimized. Lookup table added
* [Add] Option to display available coupons in cart page
* [Add] New filter `wt_sc_alter_giveaway_cart_item_data_before_add_to_cart` to alter giveaway product cart item data before adding to cart.
* [Bug fix] Email validation is not working properly when email has capital letters
* [Bug fix] Validation fails when global quantity restriction with exclude product/category exists
* [Bug fix] Takeway payment gateway payment method is not listing in admin dropdown
* [Bug fix] Not taking coupons having multiple user role restriction.
* [Bug fix] Coupon expired text is not translating.
* [Compatibility] WC 7.1
* [Compatibility] WP 6.1


= 1.4.2 - 14-09-2022 =
* [Bug fix] Removing manually applied auto coupons when email restrictions are present
* [Bug fix] Coupons are not displaying in my account
* [Bug fix] Style breaking issue in Google chrome latest version.
* [Bug fix] Custom coupon style not showing in frontend.
* [Bug fix] getTimestamp() on int
* [Improvement] Optimized available coupons SQL query
* [Compatibility] WC 6.9.0
* [Compatibility] WP 6.0.2

= 1.4.1 - 01-09-2022 =
* [Bug fix] null value metas converted to empty string on duplicate functionality
* [Bug fix] Not automatically applying coupons with wild card(*) email restriction.
* [Bug fix] Conflict with auto apply and coupon individual use.
* [Bug fix] Causing error on YITH POS custom add to cart
* [Bug fix] Start date validation issue
* [Bug fix] Expired coupons are applying in auto coupons.
* [Add] Coupon URL help popup added in coupon edit page.
* [Add] Pagination added for available coupons
* [Improvement] Decimal support added in price columns of admin giveaway tab
* [Improvement] BOGO total giveaway discount now showing as coupon discount in cart summary
* [Compatibility] QPilot Autoship plugin
* [Compatibility] WC 6.8.2
* [Compatibility] WP 6.0.1

= 1.4.0 - 27-06-2022 =
* [New] `BOGO offers` option introduced.
* [New] Individual product/category quantity restriction.
* [Compatibility] with WooCommerce 6.6


= 1.3.9 =
* [Compatibility] with WooCommerce 6.5.1
* [Compatibility] with WordPress 6.0
* [Compatibility] with YITH POS. Thanks @youssefhegazy
* [Bug fix] Giveaway product is not adding to cart if the chosen product is a variation.


= 1.3.8 =
* [Improvement] Coupon alignment in checkout and my account pages
* [Compatibility] with WooCommerce 6.3.1

= 1.3.7 =
* Coupon shortcode option added
* Show coupon in checkout page option added.
* [Fix] Shows a warning when `Hide shipping costs until an address is entered` option enabled.
* [Fix] Coupon expiry date not showing correctly
* [Compatibility] with WooCommerce 6.1.1
* [Compatibility] with WordPress 5.9


= 1.3.6 =
* [Tweak] Maximum limit option for percentage coupon
* [Improvement] Variable product compatibility in Giveaway option
* [Fix] SQL injection issue in Duplicate coupon functionality
* [Compatibility] with WooCommerce 6.0

= 1.3.5 =
* [Add] Coupon category option
* [Add] New filters: wt_smart_coupon_after_my_account_coupons, wt_smart_coupon_before_my_account_coupons
* [Tweak] Separate tab for URL coupon
* [Tweak] UI updates
* [Tweak] Help links
* [Fix] Minor bug fixes
* [Fix] Coupon URL preview not working on coupon code generate.
* [Improvement] Styles and scripts limited to WC pages and Smart coupon settings pages
* [Improvement] New argument $coupon_obj for filter `wt_smart_coupon_before_my_account_single_coupon`
* [Compatibility] with WooCommerce 5.9
* [Deprecated] filter: wt_smart_coupon_before_my_acocount_coupons

= 1.3.4 =
* [Compatibility] with WooCommerce 5.8
* [Bug fix] Auto apply coupon limit issue.
* [Tweak] Showing coupon URL preview on coupons add/edit page
* [Add] Translations added for AR, AF, CZ, DE, ES, FR, IT, MY, RU

= 1.3.3 =
* Tested OK with WC 5.6
* [Bug fix] Displaying all coupons in My Account when the eligible coupon list is empty.
* Customization/hide option via filter added for free product added success message. Filter: `wt_smart_coupon_free_product_added_message`

= 1.3.2 =
* Tested OK with WP 5.8
* Tested OK with WC 5.5
* [Bug fix] Excluded free products from calculating total quantity of matching products

= 1.3.1 =
* Tested OK with WC 5.4
* [Bug fix] Coupon still showing in `My account` when `Show in My account` option disabled.
* [Bug fix] Giveaway product is added repeatedly when logged in back to the site.
* [Bug fix] Buy Giveaway products individually
* [Bug fix] Removes any free products from the cart if their related coupon is not present in the cart

= 1.3.0 =
* Tested OK with WC 5.2

= 1.2.9 =
* Tested OK with WP 5.7.0
* Tested OK with WC 5.1.0

= 1.2.8 =
* Fix: Auto apply of coupons fails when email restriction was added.
* Tested OK with WC 4.9.0
* Tested OK with WP 5.6.0

= 1.2.7 =
* Fix: Auto apply coupon of fixed amount discount on subscription sign up fee is taking cart total to 0
* Tested OK with WC 4.7.0
* Tested OK with WP 5.5.3

= 1.2.6 =
* Improvement: display coupon based on user roles
* Fix: Auto coupons are not applied properly after changing the payment method
* Tested OK with WP 5.5.2
* Tested OK with WC 4.5.2

= 1.2.5 =
* [Fix] Auto coupons are not applied properly.
* Tested OK with WC 4.2.0

= 1.2.4 =
* [Fix] The auto coupon is not applied if the checkout page is directly visited after the product has added to the cart.
* [Fix] Fixed languages translation issues.
* Tested OK with WC 4.1.0
* Updated translation files

= 1.2.3 =
* [Fix] - Memory limit exceeded error when a large number of auto coupons are present.
* Added a filter `wt_smartcoupon_max_auto_coupons_limit` to limit the maximum number of auto coupons that can be applied

= 1.2.2 =
* Tested OK with WP 5.4

= 1.2.1 =
* Tested OK with WC 3.9.2
* [fix] Giveaway product is not removed from the cart even if all the applied coupon products are removed
* [fix] Smart coupon start date is not working properly

= 1.2.0 =
* [Improvement] Security

= 1.1.9 =
* Tested OK with WooCommerce 3.8.1
* Removed quantity updates for giveaway item 

= 1.1.8 =
* Tested OK with WP 5.3
* [update] Content update
* [update] Activate WooCommerce Coupon module on plugin activation.
* [fix] Fixed issues in discount calculation for giveaway product.


= 1.1.7 =
* Tested OK with WP 5.2.4
* Tested OK with WC 3.8.0
* [update] Fixed Currency position all over the plugin. Thanks @imborx reporting issue.
* [update] Added filter for formatted text "wt_smart_coupon_meta_data"

= 1.1.6 =
* Tested OK with WP 5.2.3


= 1.1.5 =
* WPML compatiblity
* Content update

= 1.1.4 =
* Implemented URL coupon
* Content update

= 1.1.3 =
* Implemented Start date for coupon.
* Tested ok with WC 3.6.4
* Tested ok with WordPress 5.2.1
* Content Update.


= 1.1.2 =
* Fixed PHP Warning in Exclude Product section.
* Tested ok with WC 3.6.2
* Content Update.


= 1.1.1 =
* Ability to omit coupons from applying for specific products.
* Tested ok with WC 3.6.1

= 1.1.0 =
* Included option to automatically apply coupon.
* Tested ok with WP 5.1.1 and WC 3.5.7

= 1.0.1 =
* Customize myCoupon Styles.
* Readme updates.

= 1.0.0 =
* Updated Language translation

= 0.0.9 =
* Additional filters in usage restriction by product/min-max subtotal/min-max quantity
* Giveaway free products(simple products)
* Option to list applicable coupons under users My account->My Coupons
* Categorized view of Active/Used/Expired coupons
* Tested OK with the latest version of WordPress and WooCommerce

= 0.0.8 =
* Updated read me - tested OK with latest version of WP and WC

= 0.0.7 =
* Content updates.
* Tested OK with Wordpress 5.0.2
* Tested OK with WC 3.5.3

= 0.0.6 =
* Content updates.

= 0.0.5 =
* Content updates.

= 0.0.4 =
* Content updates.

= 0.0.3 =
* Tested OK with WC 3.5.1.

= 0.0.2 =
* Tested OK with WC 3.4.4.

= 0.0.1 =
* Initial commit.

== Upgrade Notice ==

= 1.6.1 =
* [Fix] Auto coupon not working on pages other than cart and checkout.
* [Fix] Checkout validations are not working.