WooCommerce Bulk Discount - Version 2.4.1

Version Description

Download this release

Release Info

Developer Rene Puchinger
Plugin Icon 128x128 WooCommerce Bulk Discount
Version 2.4.1
Comparing to
See all releases

Code changes from version 2.4.0 to 2.4.1

Files changed (2) hide show
  1. readme.txt +11 -1
  2. woocommerce-bulk-discount.php +18 -53
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_butt
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.6
6
  Tested up to: 4.4.2
7
- Stable tag: 2.4.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -66,6 +66,10 @@ WooCommerce Bulk Discount has been localised to these languages:
66
  * <a href="http://codecanyon.net/item/woocommerce-free-gift/6144902?ref=renp">WooCommerce Free Gift</a>
67
  * <a href="http://codecanyon.net/item/woocommerce-gift-coupons/6207561?ref=renp">WooCommerce Gift Coupons</a>
68
 
 
 
 
 
69
  == Installation ==
70
 
71
  1. Download the latest version and extract it in the /wp-content/plugins/ directory
@@ -155,6 +159,9 @@ In the bulk discount section of this private product set the discount as in the
155
 
156
  == Changelog ==
157
 
 
 
 
158
  = 2.4.0 =
159
  * (12 Feb 2016) new feature - it is now possible to set the discount globally for all products.
160
 
@@ -275,6 +282,9 @@ In the bulk discount section of this private product set the discount as in the
275
 
276
  == Upgrade Notice ==
277
 
 
 
 
278
  = 2.4.0 =
279
  New feature release.
280
 
4
  Tags: woocommerce, bulk, discount
5
  Requires at least: 3.6
6
  Tested up to: 4.4.2
7
+ Stable tag: 2.4.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
66
  * <a href="http://codecanyon.net/item/woocommerce-free-gift/6144902?ref=renp">WooCommerce Free Gift</a>
67
  * <a href="http://codecanyon.net/item/woocommerce-gift-coupons/6207561?ref=renp">WooCommerce Gift Coupons</a>
68
 
69
+ **Recommended WordPress theme. There is everything you need:**
70
+
71
+ * <a href="http://themeforest.net/item/x-the-theme/5871901?ref=renp">Theme X</a>
72
+
73
  == Installation ==
74
 
75
  1. Download the latest version and extract it in the /wp-content/plugins/ directory
159
 
160
  == Changelog ==
161
 
162
+ = 2.4.1. =
163
+ * (20 Feb 2016) Removed unnecessary setting field for enabling/disabling the plugin core functionality.
164
+
165
  = 2.4.0 =
166
  * (12 Feb 2016) new feature - it is now possible to set the discount globally for all products.
167
 
282
 
283
  == Upgrade Notice ==
284
 
285
+ = 2.4.1. =
286
+ Maintenance release.
287
+
288
  = 2.4.0 =
289
  New feature release.
290
 
woocommerce-bulk-discount.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WooCommerce Bulk Discount
4
  Plugin URI: http://wordpress.org/plugins/woocommerce-bulk-discount/
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
- Version: 2.4.0
8
  Author URI: https://profiles.wordpress.org/rene-puchinger/
9
  License: GPL3
10
 
@@ -71,28 +71,24 @@ if ( !class_exists( 'Woo_Bulk_Discount_Plugin_t4m' ) ) {
71
  */
72
  public function woocommerce_loaded() {
73
 
74
- if ( get_option( 'woocommerce_t4m_enable_bulk_discounts', 'yes' ) == 'yes' ) {
75
-
76
- add_action( 'woocommerce_before_calculate_totals', array( $this, 'action_before_calculate' ), 10, 1 );
77
- add_action( 'woocommerce_calculate_totals', array( $this, 'action_after_calculate' ), 10, 1 );
78
- add_action( 'woocommerce_before_cart_table', array( $this, 'before_cart_table' ) );
79
- add_action( 'woocommerce_single_product_summary', array( $this, 'single_product_summary' ), 45 );
80
- add_filter( 'woocommerce_cart_item_subtotal', array( $this, 'filter_subtotal_price' ), 10, 2 );
81
- add_filter( 'woocommerce_checkout_item_subtotal', array( $this, 'filter_subtotal_price' ), 10, 2 );
82
- add_filter( 'woocommerce_order_formatted_line_subtotal', array( $this, 'filter_subtotal_order_price' ), 10, 3 );
83
- add_filter( 'woocommerce_product_write_panel_tabs', array( $this, 'action_product_write_panel_tabs' ) );
84
- add_filter( 'woocommerce_product_write_panels', array( $this, 'action_product_write_panels' ) );
85
- add_action( 'woocommerce_process_product_meta', array( $this, 'action_process_meta' ) );
86
- add_filter( 'woocommerce_cart_product_subtotal', array( $this, 'filter_cart_product_subtotal' ), 10, 3 );
87
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'order_update_meta' ) );
88
-
89
- if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) {
90
- add_filter( 'woocommerce_cart_item_price', array( $this, 'filter_item_price' ), 10, 2 );
91
- add_filter( 'woocommerce_update_cart_validation', array( $this, 'filter_before_calculate' ), 10, 1 );
92
- } else {
93
- add_filter( 'woocommerce_cart_item_price_html', array( $this, 'filter_item_price' ), 10, 2 );
94
- }
95
 
 
 
 
 
 
96
  }
97
 
98
  }
@@ -827,15 +823,6 @@ if ( !class_exists( 'Woo_Bulk_Discount_Plugin_t4m' ) ) {
827
 
828
  array( 'name' => __( 'Bulk Discount', 'wc_bulk_discount' ), 'type' => 'title', 'desc' => __( 'The following options are specific to product bulk discount.', 'wc_bulk_discount' ) . '<br /><br/><strong><i>' . __( 'After changing the settings, it is recommended to clear all sessions in WooCommerce &gt; System Status &gt; Tools.', 'wc_bulk_discount' ) . '</i></strong>', 'id' => 't4m_bulk_discounts_options' ),
829
 
830
- array(
831
- 'name' => __( 'Bulk Discount globally enabled', 'wc_bulk_discount' ),
832
- 'id' => 'woocommerce_t4m_enable_bulk_discounts',
833
- 'desc' => __( '', 'wc_bulk_discount' ),
834
- 'std' => 'yes',
835
- 'type' => 'checkbox',
836
- 'default' => 'yes'
837
- ),
838
-
839
  array(
840
  'title' => __( 'Discount Type', 'wc_bulk_discount' ),
841
  'id' => 'woocommerce_t4m_discount_type',
@@ -929,28 +916,6 @@ if ( !class_exists( 'Woo_Bulk_Discount_Plugin_t4m' ) ) {
929
 
930
  ) ); // End settings
931
 
932
- $js = "
933
- jQuery('#woocommerce_t4m_enable_bulk_discounts').change(function() {
934
-
935
- jQuery('#woocommerce_t4m_cart_info, #woocommerce_t4m_variations_separate, #woocommerce_t4m_discount_type, #woocommerce_t4m_css_old_price, #woocommerce_t4m_css_new_price, #woocommerce_t4m_show_on_item, #woocommerce_t4m_show_on_subtotal, #woocommerce_t4m_show_on_order_subtotal').closest('tr').hide();
936
-
937
- if ( jQuery(this).attr('checked') ) {
938
- jQuery('#woocommerce_t4m_cart_info').closest('tr').show();
939
- jQuery('#woocommerce_t4m_variations_separate').closest('tr').show();
940
- jQuery('#woocommerce_t4m_discount_type').closest('tr').show();
941
- jQuery('#woocommerce_t4m_css_old_price').closest('tr').show();
942
- jQuery('#woocommerce_t4m_css_new_price').closest('tr').show();
943
- jQuery('#woocommerce_t4m_show_on_item').closest('tr').show();
944
- jQuery('#woocommerce_t4m_show_on_subtotal').closest('tr').show();
945
- jQuery('#woocommerce_t4m_show_on_order_subtotal').closest('tr').show();
946
- }
947
-
948
- }).change();
949
-
950
- ";
951
-
952
- $this->run_js( $js );
953
-
954
  }
955
 
956
  /**
4
  Plugin URI: http://wordpress.org/plugins/woocommerce-bulk-discount/
5
  Description: Apply fine-grained bulk discounts to items in the shopping cart.
6
  Author: Rene Puchinger
7
+ Version: 2.4.1
8
  Author URI: https://profiles.wordpress.org/rene-puchinger/
9
  License: GPL3
10
 
71
  */
72
  public function woocommerce_loaded() {
73
 
74
+ add_action( 'woocommerce_before_calculate_totals', array( $this, 'action_before_calculate' ), 10, 1 );
75
+ add_action( 'woocommerce_calculate_totals', array( $this, 'action_after_calculate' ), 10, 1 );
76
+ add_action( 'woocommerce_before_cart_table', array( $this, 'before_cart_table' ) );
77
+ add_action( 'woocommerce_single_product_summary', array( $this, 'single_product_summary' ), 45 );
78
+ add_filter( 'woocommerce_cart_item_subtotal', array( $this, 'filter_subtotal_price' ), 10, 2 );
79
+ add_filter( 'woocommerce_checkout_item_subtotal', array( $this, 'filter_subtotal_price' ), 10, 2 );
80
+ add_filter( 'woocommerce_order_formatted_line_subtotal', array( $this, 'filter_subtotal_order_price' ), 10, 3 );
81
+ add_filter( 'woocommerce_product_write_panel_tabs', array( $this, 'action_product_write_panel_tabs' ) );
82
+ add_filter( 'woocommerce_product_write_panels', array( $this, 'action_product_write_panels' ) );
83
+ add_action( 'woocommerce_process_product_meta', array( $this, 'action_process_meta' ) );
84
+ add_filter( 'woocommerce_cart_product_subtotal', array( $this, 'filter_cart_product_subtotal' ), 10, 3 );
85
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'order_update_meta' ) );
 
 
 
 
 
 
 
 
 
86
 
87
+ if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) {
88
+ add_filter( 'woocommerce_cart_item_price', array( $this, 'filter_item_price' ), 10, 2 );
89
+ add_filter( 'woocommerce_update_cart_validation', array( $this, 'filter_before_calculate' ), 10, 1 );
90
+ } else {
91
+ add_filter( 'woocommerce_cart_item_price_html', array( $this, 'filter_item_price' ), 10, 2 );
92
  }
93
 
94
  }
823
 
824
  array( 'name' => __( 'Bulk Discount', 'wc_bulk_discount' ), 'type' => 'title', 'desc' => __( 'The following options are specific to product bulk discount.', 'wc_bulk_discount' ) . '<br /><br/><strong><i>' . __( 'After changing the settings, it is recommended to clear all sessions in WooCommerce &gt; System Status &gt; Tools.', 'wc_bulk_discount' ) . '</i></strong>', 'id' => 't4m_bulk_discounts_options' ),
825
 
 
 
 
 
 
 
 
 
 
826
  array(
827
  'title' => __( 'Discount Type', 'wc_bulk_discount' ),
828
  'id' => 'woocommerce_t4m_discount_type',
916
 
917
  ) ); // End settings
918
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
919
  }
920
 
921
  /**