Discount Rules for WooCommerce - Version 1.2

Version Description

Download this release

Release Info

Developer flycart
Plugin Icon 128x128 Discount Rules for WooCommerce
Version 1.2
Comparing to
See all releases

Code changes from version 1.1 to 1.2

Files changed (4) hide show
  1. helper/general-helper.php +2 -1
  2. loader.php +7 -3
  3. readme.txt +10 -20
  4. woo-discount-rules.php +1 -1
helper/general-helper.php CHANGED
@@ -75,7 +75,8 @@ if ( ! class_exists( 'woo_dicount_rules_generalHelper' ) ) {
75
  {
76
  $postData = \FlycartInput\FInput::getInstance();
77
  $tab = $this->default_page;
78
- if (!empty($postData->get('tab', null)) && $postData->get('tab', '') != '') {
 
79
  $tab = sanitize_text_field($postData->get('tab', ''));
80
  }
81
  return $tab;
75
  {
76
  $postData = \FlycartInput\FInput::getInstance();
77
  $tab = $this->default_page;
78
+ $empty_tab = $postData->get('tab', null);
79
+ if (!empty($empty_tab) && $postData->get('tab', '') != '') {
80
  $tab = sanitize_text_field($postData->get('tab', ''));
81
  }
82
  return $tab;
loader.php CHANGED
@@ -3,7 +3,7 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
  /**
4
  * Version of Woo Discount Rules.
5
  */
6
- define('WOO_DISCOUNT_VERSION', '1.0');
7
  /**
8
  * Required Version of WooCommerce to Run.
9
  */
@@ -50,9 +50,13 @@ $postData = \FlycartInput\FInput::getInstance();
50
  // ----------------------------------------------------WooCommerce HOOK-------------------------------------------------
51
 
52
  // Handling Tight update with wooCommerce Changes.
53
- if ((!empty($postData->get('add-to-cart')) && is_numeric($postData->get('add-to-cart'))) || $postData->get('action', false) == 'woocommerce_add_to_cart') {
 
 
 
 
54
  // add_action('woocommerce_add_to_cart', array($discountBase, 'handleDiscount'), 19);
55
- } else if (!empty($postData->get('apply_coupon')) || !empty($postData->get('update_cart')) || !empty($postData->get('proceed'))) {
56
  // add_action('woocommerce_before_cart_item_quantity_zero', array($discountBase, 'handleDiscount'), 100);
57
  add_action('woocommerce_after_cart_item_quantity_update', array($discountBase, 'handleDiscount'), 100);
58
 
3
  /**
4
  * Version of Woo Discount Rules.
5
  */
6
+ define('WOO_DISCOUNT_VERSION', '1.2');
7
  /**
8
  * Required Version of WooCommerce to Run.
9
  */
50
  // ----------------------------------------------------WooCommerce HOOK-------------------------------------------------
51
 
52
  // Handling Tight update with wooCommerce Changes.
53
+ $empty_add_to_cart = $postData->get('add-to-cart');
54
+ $empty_apply_coupon = $postData->get('apply_coupon');
55
+ $empty_update_cart = $postData->get('update_cart');
56
+ $empty_proceed = $postData->get('proceed');
57
+ if ((!empty($empty_add_to_cart) && is_numeric($postData->get('add-to-cart'))) || $postData->get('action', false) == 'woocommerce_add_to_cart') {
58
  // add_action('woocommerce_add_to_cart', array($discountBase, 'handleDiscount'), 19);
59
+ } else if (!empty($empty_apply_coupon) || !empty($empty_update_cart) || !empty($empty_proceed)) {
60
  // add_action('woocommerce_before_cart_item_quantity_zero', array($discountBase, 'handleDiscount'), 100);
61
  add_action('woocommerce_after_cart_item_quantity_update', array($discountBase, 'handleDiscount'), 100);
62
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WooCommerce Discount Rules ===
2
  Contributors: flycart
3
- Donate link: https://flycart.org/
4
  Tags: woocommerce, ecommerce, discounts, coupons, promotion, campaigns, sales, price rules, advanced coupons, advanced discounts
5
  Requires at least: 4.4.1
6
- Tested up to: 4.7
7
- Stable tag: 1.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -15,9 +15,7 @@ Create any type of discount and pricing rules in your WooCommerce Store. Run fle
15
  Increase your sales multifold by offering flexible, customised discounts in your WooCommerce online store. Attract more customers.
16
  Encourage bulk purchases by providing discounts.
17
 
18
- [View Demo](http://demo.flycart.org/woo-discount-rules) | [Documentation](https://www.flycart.org/docs/wordpress/woo-discount-rules)
19
-
20
- = Use cases =
21
 
22
  * Buy 5 items and get 10 % discount
23
  * Buy T-shirts from Winter Collections and save 10 %
@@ -27,7 +25,7 @@ Encourage bulk purchases by providing discounts.
27
  * Add 5 items to your shopping bag and get 10% discount
28
  * Special offer for Customers from California. Get 25 % discount
29
 
30
- = Adjustment rules =
31
 
32
  * Category specific discount on product price
33
  * Date and Time based discount on product price
@@ -37,10 +35,10 @@ Encourage bulk purchases by providing discounts.
37
  * Total Sum of Item quantities
38
  * Shipping address based discount rule
39
 
40
- = Conditions based on =
41
  Products, categories, customers, customer roles, shipping location and more.
42
 
43
- = Rules apply based on =
44
 
45
  * Products
46
  * Line items in cart
@@ -48,9 +46,9 @@ Products, categories, customers, customer roles, shipping location and more.
48
  * Line item quantity
49
  * Total cart quantity
50
 
51
- [PRO version](https://www.flycart.org/products/wordpress/woocommerce-discount-rules)
52
 
53
- = PRO only features =
54
 
55
  * Fixed price discount for Quantity based discount conditions ( Get $9 discount for purchasing over 6 items)
56
  * Category specific discount conditions ( Get 25 % off on all items under Summer Collection )
@@ -80,14 +78,6 @@ More information could be found in the documentation
80
 
81
  == Frequently asked questions ==
82
 
83
- == Screenshots ==
84
-
85
- 1. Woo Discount Rules menu
86
- 2. Price rules and Cart rules
87
- 3. Creating a price rule
88
- 4. Example Promotion Offers created using Woo Discount rules
89
- 5. Discounted price is applied in the Cart
90
-
91
  == Changelog ==
92
 
93
  == Upgrade notice ==
1
+ === Woo Discount Rules ===
2
  Contributors: flycart
3
+ Donate link:
4
  Tags: woocommerce, ecommerce, discounts, coupons, promotion, campaigns, sales, price rules, advanced coupons, advanced discounts
5
  Requires at least: 4.4.1
6
+ Tested up to: 4.6.1
7
+ Stable tag: 1.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
15
  Increase your sales multifold by offering flexible, customised discounts in your WooCommerce online store. Attract more customers.
16
  Encourage bulk purchases by providing discounts.
17
 
18
+ ** Use cases **
 
 
19
 
20
  * Buy 5 items and get 10 % discount
21
  * Buy T-shirts from Winter Collections and save 10 %
25
  * Add 5 items to your shopping bag and get 10% discount
26
  * Special offer for Customers from California. Get 25 % discount
27
 
28
+ ** Adjustment rules **
29
 
30
  * Category specific discount on product price
31
  * Date and Time based discount on product price
35
  * Total Sum of Item quantities
36
  * Shipping address based discount rule
37
 
38
+ ** Conditions based on **
39
  Products, categories, customers, customer roles, shipping location and more.
40
 
41
+ ** Rules apply based on **
42
 
43
  * Products
44
  * Line items in cart
46
  * Line item quantity
47
  * Total cart quantity
48
 
49
+ === PRO version ===
50
 
51
+ === PRO only features ===
52
 
53
  * Fixed price discount for Quantity based discount conditions ( Get $9 discount for purchasing over 6 items)
54
  * Category specific discount conditions ( Get 25 % off on all items under Summer Collection )
78
 
79
  == Frequently asked questions ==
80
 
 
 
 
 
 
 
 
 
81
  == Changelog ==
82
 
83
  == Upgrade notice ==
woo-discount-rules.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
- * Version: 1.1
9
  * Requires at least: 4.6.1
10
  */
11
 
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.2
9
  * Requires at least: 4.6.1
10
  */
11