=== WooCommerce Extended Coupon Features FREE === Contributors: josk79 Tags: woocommerce, coupons, discount Requires at least: 5.0 Requires PHP: 7.0 Tested up to: 6.7.1 Stable tag: 3.3.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Additional functionality for WooCommerce Coupons: Allow discounts to be automatically applied, applying coupons via url, etc... == Description == "WooCommerce Extended Coupon Features" adds functionality to the WooCommerce coupons and allows for automatic discount rules. Very easy to use, the functionality is conveniently integrated to the WooCommerce Edit Coupon panel. Requires: * WooCommerce 5.0 or newer (6.0+ recommended) * PHP 7.0 or newer (7.2+ Recommended) * WordPress 5.0 or newer Full documentation is available at [www.soft79.nl](http://www.soft79.nl/documentation/wjecf). * *Auto coupons*: Allow coupons to be automatically added to the users cart if its restrictions are met, * Apply coupon via an url, * Restrict coupon by shipping method, * Restrict coupon by payment method, * Restrict coupon by a combination of products * Restrict coupon to certain customer roles * (PRO) Add *free products* to the customer's cart based on coupon rules * (PRO) Allow a cart discount to be applied based on quantity / subtotal of matching products * (PRO) Set Auto Coupon priorities (Useful for 'Individual Use Only'-coupons) * (PRO) Restrict coupon by shipping zone * (PRO) Allow coupon for first purchase only * (PRO) API to allow developers to use functions of this plugin For more information or the PRO version please visit [www.soft79.nl](http://www.soft79.nl) = Example: Auto coupon = Let the customer have a discount of $ 5.00 when the cart reaches $ 50.00. 1. Create a coupon, let's name it *auto_50bucks* and enter a short description e.g. *$ 50.00 order discount* 2. On the General tab: Select discount type *Cart discount*, and set the coupon amount to $ 5.00 3. On the Usage restrictions tab: Set minimum spend to $ 50.00 and check the *Auto coupon*-box Voila! The discount will be applied when the customer reaches $ 50.00 and a descriptive message will be shown. If the restrictions are no longer met, it will silently be removed from the cart. = Example: Apply coupon via an URL = Apply coupon through an url like this: 1. Use the url www.example.com/url-to-shop?apply_coupon=my_coupon&fill_cart=123 Voila! Any coupon can be applied this way. Please note that an empty cart can not contain any coupons. Download the free [Cart Links for WooCommerce-plugin](https://www.soft79.nl/product/cart-links-for-woocommerce/) to handle the 'fill_cart'-part of the url. This plugin has been tested in combination with [WP-Multilang](https://wordpress.org/plugins/wp-multilang/). == Installation == 1. Upload the plugin in the `/wp-content/plugins/` directory, or automatically install it through the 'New Plugin' menu in WordPress 2. Activate the plugin through the 'Plugins' menu in WordPress = How to create an automatically added coupon? = 1. Create a coupon through the 'Coupons' menu in WooCommerce. TIP: Name it auto_'whatever' so it will be easy to recognize the auto coupons 2. Setup the coupon as you'd normally would. Make sure you enter a description for the coupon and set usage restrictions 3. In the "Miscellaneous" tab, check the box *Auto coupon* 4. Voila! That's it == Frequently Asked Questions == = Is the plugin translatable? = Yes, all string values are translatable through the supplied POT/PO/MO files. In WPML translatable items appear in the context `woocommerce-jos-autocoupon` in "String Translations". = Why isn't my coupon applied using www.example.com?apply_coupon=my_coupon ? = The coupon will only be applied if the url links to a WooCommerce page (e.g. product loop / cart / product detail ) and at least one product is in the cart. An empty cart can not have any coupons. The PRO version of this plugin has a work around for this though; it will 'remember' the coupon and apply it at the moment the cart contains a product. = The cart is not updated after changing the payment method = On the settings page (Settings > WooCommerce Extended Coupon Features) check the box *Update order review on payment method change*. = The cart is not updated after changing the billing email address = On the settings page (Settings > WooCommerce Extended Coupon Features) check the box *Update order review on billing email change*. == Screenshots == 1. Allow a coupon to be applied automatically by checking "Auto coupon". 2. Extra restrictions. E.g. Quantity or subtotal of matching products. 3. (PRO) A free product has been applied to the cart 4. Additional restrictions based on shipping or payment method or the customer == Changelog == = 3.3.8 = *Release Date - 2024-11-23* - FIX: Loading of translations too early = 3.3.7 = *Release Date - 2024-10-17* - (PRO) FIX: Coupon queueing incompatibility with WooCommerce Blocks = 3.3.6 = *Release Date - 2024-10-06* - Update documentation = 3.3.5 = *Release Date - 2024-05-14* - (PRO) FIX: Custom field AND comparison = 3.3.4 = *Release Date - 2023-11-05* - (PRO) FEATURE: Limit discount to: Nth item onwards - (PRO) FEATURE: Custom meta: include attribute_pa_* fields = 3.3.3 = *Release Date - 2023-03-11* - Introduce filter wjecf_coupon_item_quantity to override matching item quantity - HPOS compatibility - FIX: Don't let WooCommerce Subscriptions plugin remove autocoupons when calculating on a different cart = 3.3.2 = *Release Date - 2022-09-28* - (PRO) FIX: Custom fields: also lookup field of parent in case of a variation = 3.3.0 = *Release Date - 2022-09-18* - (PRO) FIX: On some systems auto update request was issued too often - (PRO) FIX: zip package must contain the woocommerce-auto-added-coupons-pro/ subdirectory = 3.2.9 = *Release Date - 2022-01-16* - FIX: Last update broke BOGO. (Thanks for informing us, Celian) = 3.2.8 = *Release Date - 2021-11-19* * FIX: Remove autocoupon, better detection if it was removed manually * FIX: (PRO) Free products: Better variation attributes support = 3.2.7 = *Release Date - 2021-02-13* * FIX: User restrictions on backend orders = 3.2.6 = *Release Date - 2021-01-16* * (PRO) FIX: Don't display free product selection when there are no items to choose from * FEATURE: 'Table Rate Shipping' by WooCommerce compatibility = 3.2.5 = *Release Date - 2020-11-30* * FEATURE: Defer an applied coupon if it's valid and 'allow queueing' is enabled * FEATURE: 'Table Rate Shipping for WooCommerce' by Border Elements compatibility * FEATURE: Support for WP-Multilang (requires patch https://github.com/VaLeXaR/wp-multilang/pull/172 in WP-Multilang) * FIX: Typo making filter 'wjecf_first_order_statuses_to_check' useless = 3.2.4 = *Release Date - 2020-11-06* * FEATURE: Flexible shipping instances compatibility = 3.2.3 = *Release Date - 2020-10-18* * PERFORMANCE: (PRO) Auto update: applied caching to prevent many requests to the webserver = 3.2.2 = *Release Date - 2020-08-27* * (PRO) First purchase only: Add 'Pending payment' to order statuses and apply filter wjecf_first_order_statuses_to_check to allow override of the statuses to check = 3.2.1 = *Release Date - 2020-08-18* * (PRO) FEATURE: Filter 'wjecf_free_products_to_apply_for_coupon' * (PRO) FEATURE: Filter 'wjecf_bogo_products_to_apply_for_coupon' = 3.2.0 = *Release Date - 2020-05-11* * (PRO) FEATURE: Limit discount to n lowest priced items * (PRO) FEATURE: Accept Envato license key * FEATURE: Include/exclude shipping method, instance or zone (PRO) * FIX: Coupon data as url: Urlencode the coupon code * FIX: Minor fix in WJECF_Debug log_the_request() = 3.1.4 = *Release Date - 2020-03-28* * (PRO) FEATURE: Restrict coupon by shipping zone = 3.1.3 = *Release Date - 2019-11-25* * (PRO) FIX: Custom meta allow number or boolean (yes | no) values = 3.1.2 = *Release Date - 2019-09-18* * (PRO) FEATURE: Filter wjecf_is_first_purchase = 3.1.1 = *Release Date - 2019-08-13* * FIX: Auto coupon priority issue when cart content changes and another 'individual use'-coupon takes precedence * (PRO) FIX: Free products: Only set cart item quantity when it has changed (fixes issue with woo-paypalplus which clears session at quantity change) = 3.1.0 = *Release Date - 2019-05-21* * TWEAK: Remove domainname from redirect url after using ?apply_coupon= * (PRO) FIX: Free products: Don't apply a product that is not purchasable * (PRO) TWEAK: Call WC core add_to_cart instead of custom add_to_cart-function * (PRO) TWEAK: Free product selection: Show variation attributes in product title = 3.0.7 = *Release Date - 2019-02-14* * FIX: wjecf_dump missing meta values * TWEAK: Changed coupon discount html overwrite of Free-product-coupons (PRO) and Auto-coupons * (PRO) FEATURE: Custom coupon error message * (PRO) FIX: Bug in 'Limit discount to' in combination with WC prior to 3.3.0 = 3.0.6 = *Release Date - 2018-11-27* * (PRO) FIX: Product custom field filter for internal meta (e.g. _sale_price) = 3.0.5 = *Release Date - 2018-11-10* * FIX: Limit discount to: in combination with WC < 3.2 * FIX: Added quantity to 'woocommerce_add_cart_item_data'-filter (Fixes crash WooCommerce Product Addons) * FIX: 'Auto coupons'-settings not visible in FREE version = 3.0.4 = *Release Date - 2018-10-12* * FIX: Auto coupons: silently remove invalid coupons * FIX: WPML compatibility issue with "CATEGORIES AND" * (PRO) FIX: CSS of the column system (box-sizing: border-box) = 3.0.2 = *Release Date - 2018-09-03* * FIX: Email restrictions compatibility with WooCommerce versions prior to 3.4 * FIX: Individual use conflict * FIX: (FREE) Missing debug template = 3.0.1 = *Release Date - 2018-09-02* * FIX: Fatal error in FREE version of the plugin * FIX: Require PHP5.4 = 3.0.0 = *Release Date - 2018-09-02* * IMPORTANT: Requires WooCommerce 3.0+ WordPress 4.8+ and PHP 5.3+ * FEATURE: Filter 'wjecf_apply_with_other_coupons' to disallow certain coupon combinations * FEATURE: Update order review on payment/billing email change on checkout page (see settings page) * FIX: Auto-coupon check usase limits per user and respect email restriction wildcards * FIX: Auto-coupon in combination with individual_use respects exception filters * FIX: Coupon queueing: Case sensitive coupon code compare issue * FIX/PERFORMANCE: Rewritten handling of auto-coupons. Performance improvement * (PRO) ENHANCEMENT: Free products: Better handling and performance of cart ajax events * (PRO) FIX: Duplicate notices when enqueuing a coupon * INTERNAL: Removed code for backwards compatibility with WC versions prior to 3.0 * INTERNAL: Rewritten boot-process. Class auto-loading. Code cleanup. = 2.6.4 = *Release Date - 2018-08-16* * FIX: Download JSON compatiblilty issue with WC 2.6.x * FIX: WPML Translate coupon title = 2.6.3 = *Release Date - 2018-06-04* * FIX: WJECF_Controller: Don't use wp_get_current_user() for admin-orders * FIX: WJECF_Controller: Don't use WC()->cart->subtotal for admin-orders * FIX: Possible division by zero when calculating multiplier value * FEATURE: Filter 'wjecf_coupon_multiplier_value' to allow overriding the coupon's multiplier value = 2.6.2 = *Release Date - 2018-04-02* * FEATURE: Auto-coupon compatibility with the 'WooCommerce Free Gift Coupons'-plugin * FIX: CATEGORIES AND in combination with variable products * FIX: Call to undefined function wc_add_notice() * FIX: (PRO) First order purchase: Ignore cancelled/waiting for payment order statuses * FIX: (PRO) Auto updater plugins_api return $def instead of false = 2.6.1.1 = *Release Date - 2017-12-24* * FIX: (PRO) Possible crash on null reference in filter woocommerce_coupon_get_discount_amount = 2.6.1 = *Release Date - 2017-12-22* * German translation (Thanks to, Guido Hloch) * FIX: Use WC_Coupon::get_description (for translation plugins) * FIX: (PRO) ADMIN - Auto update: Allow multiple license activation * FIX: (PRO) ADMIN - Auto update: Removed invalid warning 'Invalid response block' = 2.6.0.2 = *Release Date - 2017-12-04* * FIX: Typo 'impode' (Thanks to Constantine for reporting) = 2.6.0.1 = *Release Date - 2017-12-02* * ADMIN: Fix: Changelog of plugin update screen = 2.6.0 = *Release Date - 2017-12-02* * ADMIN: Compatibility with coupons added on the Order page from wp-admin (requires WC3.3+) * ADMIN: Show 'settings' link on the plugin screen * INTERNAL: Moved debugging functions to WJECF_Debug. Use template/log.php for output rendering of the log * (PRO) FEATURE: Limit coupon to first time purchase only * (PRO) ENHANCEMENT: Free products: Better grid layout of the free product selector * (PRO) ENHANCEMENT: Free products: Auto submit of selection (works for inputs in container with class 'wjecf-auto-submit') * (PRO) FIX: Free products: Respect "sold individually" when adding free products to the cart * (PRO) FIX: Free products: WC2.6 compatibility (product->get_status()) = 2.5.5.1 = *Release Date - 2017-11-07* * (PRO) FIX: 'Limit discount to' not applied correctly in combination with WC3.2.3 = 2.5.5 = *Release Date - 2017-11-01* * (PRO) FIX: Free products: Removed unnecessary