WooCommerce Bulk Discount - Version 1.0.1

Version Description

  • (5 Jul 2013) cleaned up some code.
Download this release

Release Info

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

Code changes from version 1.0 to 1.0.1

Files changed (2) hide show
  1. readme.txt +7 -1
  2. woocommerce-bulk-discount.php +16 -18
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_butt
4
  Tags: woocommerce, discount
5
  Requires at least: 3.5.0
6
  Tested up to: 3.5.2
7
- Stable tag: 1.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -63,11 +63,17 @@ Currently 5 discount lines are supported. That should be enough for reasonable f
63
 
64
  == Changelog ==
65
 
 
 
 
66
  = 1.0 =
67
  * Stable version.
68
 
69
  == Upgrade Notice ==
70
 
 
 
 
71
  = 1.0 =
72
  N/A.
73
 
4
  Tags: woocommerce, discount
5
  Requires at least: 3.5.0
6
  Tested up to: 3.5.2
7
+ Stable tag: 1.0.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
63
 
64
  == Changelog ==
65
 
66
+ = 1.0.1 =
67
+ * (5 Jul 2013) cleaned up some code.
68
+
69
  = 1.0 =
70
  * Stable version.
71
 
72
  == Upgrade Notice ==
73
 
74
+ = 1.0.1 =
75
+ This version has minor change in code without any noticeable impact.
76
+
77
  = 1.0 =
78
  N/A.
79
 
woocommerce-bulk-discount.php CHANGED
@@ -4,13 +4,27 @@ Plugin Name: WooCommerce Bulk Discount
4
  Plugin URI: http://www.tools4me.net/wordpress/woocommerce-bulk-discount-plugin
5
  Description: Apply fine-grained discounts to items in the shopping cart, dependently on ordered quantity and on concrete product.
6
  Author: Rene Puchinger
7
- Version: 1.0
8
  Author URI: http://www.renepuchinger.com
9
  */
10
 
11
  class Woo_Bulk_Discount_Plugin {
12
 
13
- public function install_plugin() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
 
16
  private function get_discounted_coeff($prodId, $price, $quantity) {
@@ -187,19 +201,3 @@ class Woo_Bulk_Discount_Plugin {
187
  }
188
 
189
  $woo_bulk_discount_plugin = new Woo_Bulk_Discount_Plugin();
190
- register_activation_hook(__FILE__, array($woo_bulk_discount_plugin, 'install_plugin'));
191
-
192
- if (get_option('woocommerce_t4m_enable_bulk_discounts') == 'yes') {
193
- add_action('woocommerce_before_calculate_totals', array($woo_bulk_discount_plugin, 'action_before_calculate'));
194
- add_action('woocommerce_calculate_total', array($woo_bulk_discount_plugin, 'action_after_calculate'));
195
- add_action('woocommerce_before_cart_table', array($woo_bulk_discount_plugin, 'before_cart_table'));
196
- add_action('woocommerce_single_product_summary', array($woo_bulk_discount_plugin, 'single_product_summary'), 45);
197
- add_filter('woocommerce_cart_item_price_html', array($woo_bulk_discount_plugin, 'filter_item_price'), 10, 2);
198
- add_filter('woocommerce_product_write_panel_tabs', array($woo_bulk_discount_plugin, 'action_product_write_panel_tabs'));
199
- add_filter('woocommerce_product_write_panels', array($woo_bulk_discount_plugin, 'action_product_write_panels'));
200
- add_action('woocommerce_process_product_meta', array($woo_bulk_discount_plugin, 'action_process_meta'));
201
- }
202
-
203
- add_filter('woocommerce_general_settings', array($woo_bulk_discount_plugin, 'action_general_settings'));
204
- add_action('admin_enqueue_scripts', array($woo_bulk_discount_plugin, 'action_enqueue_dependencies_admin'));
205
- add_action('wp_head', array($woo_bulk_discount_plugin, 'action_enqueue_dependencies'));
4
  Plugin URI: http://www.tools4me.net/wordpress/woocommerce-bulk-discount-plugin
5
  Description: Apply fine-grained discounts to items in the shopping cart, dependently on ordered quantity and on concrete product.
6
  Author: Rene Puchinger
7
+ Version: 1.0.1
8
  Author URI: http://www.renepuchinger.com
9
  */
10
 
11
  class Woo_Bulk_Discount_Plugin {
12
 
13
+ public function __construct() {
14
+ if (get_option('woocommerce_t4m_enable_bulk_discounts') == 'yes') {
15
+ add_action('woocommerce_before_calculate_totals', array($this, 'action_before_calculate'));
16
+ add_action('woocommerce_calculate_total', array($this, 'action_after_calculate'));
17
+ add_action('woocommerce_before_cart_table', array($this, 'before_cart_table'));
18
+ add_action('woocommerce_single_product_summary', array($this, 'single_product_summary'), 45);
19
+ add_filter('woocommerce_cart_item_price_html', array($this, 'filter_item_price'), 10, 2);
20
+ add_filter('woocommerce_product_write_panel_tabs', array($this, 'action_product_write_panel_tabs'));
21
+ add_filter('woocommerce_product_write_panels', array($this, 'action_product_write_panels'));
22
+ add_action('woocommerce_process_product_meta', array($this, 'action_process_meta'));
23
+ }
24
+
25
+ add_filter('woocommerce_general_settings', array($this, 'action_general_settings'));
26
+ add_action('admin_enqueue_scripts', array($this, 'action_enqueue_dependencies_admin'));
27
+ add_action('wp_head', array($this, 'action_enqueue_dependencies'));
28
  }
29
 
30
  private function get_discounted_coeff($prodId, $price, $quantity) {
201
  }
202
 
203
  $woo_bulk_discount_plugin = new Woo_Bulk_Discount_Plugin();